ITADN

Problems when adding a note

#146Closedhudbsb 创建于 2023-05-09
H
hudbsbcommented
Hello everyone. I am just a beginner in the Python world. I am trying to create a note and then add it Anki. Do I need to create the not and then create the card? How to do it? Here is my code so far: ``` from ankipandas import Collection # Path to the Anki collection path_to_collection = "C:\\Users\\hudso\\AppData\\Roaming\\Anki2" col = Collection(path_to_collection, user = "Teste") # print(col.notes.help_cols()) notes = col.notes # listing the existing models. Ex.: "Básico" print(notes.list_models()) # nmodel nflds ntags nid nguid nmod nusn:int=-1 inplace:bool=false selection = notes.add_note("Básico", {"Frente":"Pergunta1", "Verso":"Resposta1"}, "hashtagteste") print(selection) col.notes.update(selection) col.write(add=True) # Overwrites your database after creating a backup! col.db.close() ``` When I print the selection I see the note I created, however, it does not go to Anki.
关闭于 2023-05-10 2 条评论