Hi Rida,
I ran here’s a snippet to help you collect the notes attached in form of a pastebin link
You see what’s happening is you’re trying to print the note of each line present in each transaction in the nested for loop which is why it’s returning you None for the lines which have comments missing (I’m assuming you’re marking comments using semicolons ; )
Try out the code snippet linked below
https://pastebin.com/CpgK8iiv
It will print out all the comments in each of your journal posts , you just need to filter out the None lines and just append the ones which have a comment ,
Also if you want to check what attributes a post object has that you can play with and __dict__ shows you blank , try out the
dir(post) command , it will show you both the functions you can call and the variables present in the object , to print it out simple
Use a for loop to print the attributes
Something like ,
for attribute in dir(post):
print(
attribute,
"value=",
getattr(post,attribute))
If you face any issue with getting the notes using the script I gave you in pastebin , let me know I’ll try to help out , I tested the code out on my ledger file and it worked pretty well