472,364 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,364 software developers and data experts.

recommendations for personal journaling application

Hi. I've been sort of standing back on the sidelines reading this list
for awhile, and this is my first posting. So a little about myself and
my skill level. My name is Bryan. I'm new to Python and have very
little experience. I've gone through a few of the tutorials. I
understand the different data-types, basic syntax, functions and
function definition, basic iteration, and calling from modules.

I might be getting ahead of myself, but I think the best way for me to
learn things is by having a goal and working towards it. My goal is to
create a personal command line journaling application. I would like to
store all the entries in one file, have them searchable by keywords,
date, topic, etc... I think I would like to use "/*" type commands. For
instance, you call the application from a terminal window and start
with a generic prompt. You would type '/ne /t "topic"' to begin a new
entry and assign the topic; '/d' to set a date. You should be able to
use the slash commands while editing as well. For instance while
writing in an entry you could isolate a phrase or word with /k "phrase
to be marked as searchable keyword" / to mark the enclosed text as a
searchable keyword/keyphrase.

So what I'm interested in is how this would work. Is this 'event
driven' in nature? Would I define the bulk of these slash commands in a
function and then call it at the end of the script? What would be a
good module to look at for the text processing and searching aspects?
Anyways, I'm not sure how you would create a program that would
"listen" for commands and then parse them accordingly. I think for
starters I will sketch out on paper the slash commands I need, and try
to break apart the general operations into pseudo code. How would you
all approach this?

Thank you all and I hope I'm not biting off too much at once...

Oct 8 '06 #1
4 1244
Hi!

Donnie Rhodes wrote:
So what I'm interested in is how this would work. Is this 'event
driven' in nature? Would I define the bulk of these slash commands in a
function and then call it at the end of the script? What would be a
good module to look at for the text processing and searching aspects?
For implementing the commandline interface, have a look at the getopt
module.

If you store your data in a flat text file, you might use string.find()
or the re module to do the searching. The re module can search case
insensitive and is more versatile.

But maybe you want let your script create some SQL statements and use
the pysqlite module to store and search the data.

Kind regards,
Karsten.

Oct 8 '06 #2
Ant

Donnie Rhodes wrote:
....
>
Thank you all and I hope I'm not biting off too much at once...
Not if you break it up into pieces. Look at the things you want to do,
and in the first instance, create a function for each. Then you can
start to fill in the blanks, and if neccessary ask back here for advice
on each bit.

For example, your skeleton script may look something like:

def main():
options = get_options()
text = fetch_body()
entry_data = parse_text(text, options)
store_entry(entry_data)

def get_options():
pass

def fetch_body()
pass
....

if __name__ == "__main__":
main()

Ideas for the various parts:

get_options() - getopt or optparse modules (the former is simpler to
start with);

fetch_body() - just read from sys.stdin (that way you can also pipe
text into it from a file or the output from another program as well);

parse_text() - regexes could suffice if the flags and what they are
supposed to do is simple, otherwise a grammar parsing module could be
useful such as pyparsing (http://pyparsing.wikispaces.com/);

store_entry() - I'd probably go with XML for the storage format if you
really want to store the entries in a single text file, as you can
structure it well, there are good tools in python 2.5 for building xml
(xml.etree.ElementTree) and you could implement a fast search engine
using SAX. Otherwise a database may be a better option (e.g. sqlite).

Oct 8 '06 #3

"Donnie Rhodes" <da****@gmail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
keyword/keyphrase.
>
So what I'm interested in is how this would work. Is this 'event
driven' in nature?
I would call it line-input driven -- a special case that is easier to
program.
Would I define the bulk of these slash commands in a
function and then call it at the end of the script?
I would consider a dict mapping command letters to functions.

tjr

Oct 8 '06 #4
before you use re there is a quote I have seen on different boards to
remember. So you have a problem and you want to use re now you have
two problems.!!!! It was someone from thescripts.com that helped me
realise how to fix my program without re. (sorry if I have thier
website name somewhat wrong.
https://sourceforge.net/project/show...kage_id=202823
Donnie Rhodes wrote:
Hi. I've been sort of standing back on the sidelines reading this list
for awhile, and this is my first posting. So a little about myself and
my skill level. My name is Bryan. I'm new to Python and have very
little experience. I've gone through a few of the tutorials. I
understand the different data-types, basic syntax, functions and
function definition, basic iteration, and calling from modules.

I might be getting ahead of myself, but I think the best way for me to
learn things is by having a goal and working towards it. My goal is to
create a personal command line journaling application. I would like to
store all the entries in one file, have them searchable by keywords,
date, topic, etc... I think I would like to use "/*" type commands. For
instance, you call the application from a terminal window and start
with a generic prompt. You would type '/ne /t "topic"' to begin a new
entry and assign the topic; '/d' to set a date. You should be able to
use the slash commands while editing as well. For instance while
writing in an entry you could isolate a phrase or word with /k "phrase
to be marked as searchable keyword" / to mark the enclosed text as a
searchable keyword/keyphrase.

So what I'm interested in is how this would work. Is this 'event
driven' in nature? Would I define the bulk of these slash commands in a
function and then call it at the end of the script? What would be a
good module to look at for the text processing and searching aspects?
Anyways, I'm not sure how you would create a program that would
"listen" for commands and then parse them accordingly. I think for
starters I will sketch out on paper the slash commands I need, and try
to break apart the general operations into pseudo code. How would you
all approach this?

Thank you all and I hope I'm not biting off too much at once...
Oct 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Schneider | last post by:
Hi forum, can anyone tell me wether it is possible to adjust the journaling via JDBC? I have created a database (library) via CREATE SCHEMA which creates a journal and journal receiver...
14
by: Lester Manry | last post by:
First I wish to appoligies if this is OT and should be posted elsewhere. I've done a google group search and read the Comp.Lang.C FAQ in hopes of avoiding a OT or FAQ. Please direct me to a better...
23
by: craig | last post by:
This is a little off topic, but I thought it couldn't hurt to ask... I am about to purchase a new development laptop computer. Before I do, I thought I might ask the C# development community if...
20
by: Dr. Colombes | last post by:
For a personal Web site with modest throughput and interactivity demans, I'm interested in your recommendation(s) for good (cheap, reliable, Linux friendly, very little, if any, sponsor...
18
by: bjorn.augestad | last post by:
We're planning to migrate our db to new and more disk drives, faster RAID levels and more dedicated disk usage(e.g. placing the translog on dedicated disks). The db server runs on Win2003. Right...
1
by: Billy Biro | last post by:
Hi. I'm looking for some recommendations for Visual Basic 2005 books. Specifically, I'm NOT looking for books that detail the elements of the language, nor explain OOP, but rather present...
3
by: Paul | last post by:
Looking for recommendations on a programming language for a web application. I am soliciting recommendations on a programming language for a web application described below. Actually, it is not...
3
by: Stinky Pete | last post by:
Morning all, I've found over the years that this newsgroup is an absolute fountain of knowledge and I have been able to use heaps of stuff in the databases I've written. Personal knowledge and...
1
by: Cramer | last post by:
I would appreciate your recommendations for report writers for .NET Windows Forms applications. I could google this topic to get a list - but that's not what I'm after. I would like...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.