Re: Request for tips on my first python script.

2006-09-09 Thread Steven Bethard
Lex Hider wrote: > try: > opts, args = getopt.getopt(sys.argv[1:], "l:", > ["latest=", "notfound"]) > except getopt.GetoptError: > sys.exit(2) > #usage() > > for opt, arg in opts: > if opt in (

Re: Request for tips on my first python script.

2006-09-08 Thread Roberto Bonvallet
Lex Hider wrote: > Any tips on the code quality and use of python would be appreciated. I've > got a feeling the overall structure is up the creek. [...] >for opt, arg in opts: >if opt in ("-l", "--latest"): >latest = int(arg) >elif opt in ("--notfound"): >

Re: Request for tips on my first python script.

2006-09-08 Thread Maric Michaud
Le vendredi 08 septembre 2006 13:56, Maric Michaud a écrit : > [EMAIL PROTECTED] jeu sep 07 09:17:51:~/test$ export HOME=/etc > [EMAIL PROTECTED] ven sep 08 13:53:17:/home/maric/test$ cd ~ > [EMAIL PROTECTED] ven sep 08 13:53:22:~$ pwd > /etc > [EMAIL PROTECTED] ven sep 08 13:55:46:~$ python -c 'im

Re: Request for tips on my first python script.

2006-09-08 Thread Maric Michaud
Le vendredi 08 septembre 2006 13:41, Sybren Stuvel a écrit : > > HOME = os.path.expanduser("~") > > I wouldn't use this. Just use os.environ['HOME']. In most cases it > turns out to be the same directory, but it adds more flexibility. If > someone wants your app to read/write to another directory,

Re: Request for tips on my first python script.

2006-09-08 Thread Sybren Stuvel
Lex Hider enlightened us with: > Any tips on the code quality and use of python would be appreciated. > I've got a feeling the overall structure is up the creek. I'll post some remarks about the code ;-) > HOME = os.path.expanduser("~") I wouldn't use this. Just use os.environ['HOME']. In most c

Re: Request for tips on my first python script.

2006-09-08 Thread Bruno Desthuilliers
Lex Hider wrote: > Hi, > Apologies if this is against etiquette. I've just got my first python app up > and running. It is a podcast aggregator depending on feedparser. I've really > only learnt enough to get this up and running. > > Any tips on the code quality and use of python would be apprec

Request for tips on my first python script.

2006-09-07 Thread Lex Hider
Hi, Apologies if this is against etiquette. I've just got my first python app up and running. It is a podcast aggregator depending on feedparser. I've really only learnt enough to get this up and running. Any tips on the code quality and use of python would be appreciated. I've got a feeling th