Learning Basics

Brad deviantbunnylord at gmail.com
Sun Jul 8 19:10:04 CEST 2007


So I've been studying python for a few months (it is my first foray
into computer programming) and decided to write my own little simple
journaling program. It's all pretty basic stuff but I decided that I'd
learn more from it if more experienced programmers could offer some
thoughts on how I could do things better.

#simple little journal

from time import asctime
myjournal=file('journal.txt','a+')

formatter="*"*80+"\n"
todaysdate=asctime()
myjournal.write(formatter)
myjournal.write(todaysdate + "\n\n")

loop="set"

while loop!=':a':
    loop=raw_input(':')
    if loop!=':a':
        myjournal.write(loop+"\n")
    if loopz==':a':
        myjournal.close()

#end of stuff

So I'd appreciate some good feedback or ideas.




More information about the Python-list mailing list