[Python] Python, PyKeePass - cant append new tag to entry

Discussão em 'Python' iniciado por Stack, Fevereiro 20, 2025.

  1. Stack

    Stack Membro Participativo

    I cant find out way how to append new tag in entry via PyKeePass first of all lets show my code i was expecting should work:

    # env='ACC'
    def appendTagKP(env):
    kp = PyKeePass(r'D:\users\\NewDatabase.kdbx', password=decodeStr(kp_password))

    test = kp.find_entries(tags='test', first=False)
    if test:
    for i in test:
    print(i.title)
    i.tags.append(env)
    print(f'After tags edit: {i.tags}')
    print(i.password)
    kp.save()


    Type of "i.tags" is 'LIST' thats why i expecting that append should work...

    In kdbx i have two entries that already have one tag "test":

    Title: jhr

    tags: ['test']

    and

    Title: jhrjhr

    tags: ['test']

    When i run this code, output is just those prints without new tags, i've alreday tried some small edits thats to AI and google but nothing helped. This is my last chance :D

    My expect is output where my entries have two tags: After tags edit: ['test','ACC']

    Continue reading...

Compartilhe esta Página