A(nother) python script to take notes. Command line interface.
I’ve written a small program to take notes. It is very simple, with command line interface, but if you really want you can transform in something more remarkable.
Very short guide:
Run the program from terminal:
./appunti.py path-to-your-database-file
(your database file will be a text file, if it doesn’t exist, it will be created, else new notes will be appended to it)
now you can search, obtain a list, quit or write
Hit enter to write, the normal structure of a note looks like that:
title:
contents:
website:
keywords:
Type whatever you like and hit return, than you will be asked if you want to accept your note: type ‘y’ to accept or something else to reject.
Type list to obtain a list of all the notes.
Type search to make a search:
search for:
in fields:
Type the name of the fields you want to search in, separated by spaces. If you type the wrong name it will be discarded, if you don’t provide valid fields you will be asked again and again.
Type quit to exit.
Now what if you don’t like my note structure? Well, open the file appunti.py, find this fragment
#here you can define your post structure creating fields with item
title, f_title = item ('title')
contents, f_contents = item ('contents')
keywords, f_keywords = item ('keywords')
website, f_website = item ('website')
date, f_date = item ('date')
you can create or delete fields here (note, date is automatically filled, please don’t delete) with the function item. Call item(nameofyourfield) and you obtain a make function and a finder function, save with two variables.
Than search for these lines in the start function:
search = searcher({'title': f_title, 'contents': f_contents, 'keywords': f_keywords,\
'website':f_website, 'date': f_date}, opener)
post = poster((('title: ', title), ('contents: ', contents),('website: ', website),\
('keywords: ', keywords)))
Modify it to reflect the changing in the note structure (the second is used for getting the post from your input (first is the prompt), this is the reason for the lack of date field.)






COMMENTS
comments rss | trackback uriLeave your feedback
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>