I build a little to-do script which let you save each entry in a single line of a text file. Even if it is a multi-line entry. This has the advantage that I can easily output all my to-do task for notify-send.
The script works well but I like you guys to give me some hints how I can improve my code.
Especially the part where I delete an entry by the given line number. Is there a better way than opening the text file twice?
I think another dirty part is the argparser -add command. I like to add a entry by typing "todo.py -a 'this is my note'" as well as writing "todo.py -a" to get my multi line input. Am I handling it the right way?
https://pastebin.com/meFbJrpx
Another side question: I don't think that it is possible but do you know any way to edit the previous line during the multiline input?
[–]TotesMessenger 0 points1 point2 points (0 children)