Learing Python, Newbie question

Steve Holden sholden at holdenweb.com
Fri Oct 26 04:43:20 CEST 2001


"Johannes Gamperl" <info at devshare.de> wrote ...
> sholden at holdenweb.com says...
> 
> > >
> > Erm, what's wrong with:
> > 
> >     db_first = not os.path.exists("gbook.txt") # best?
> > 
>  
> i found this one is a good deal for me :-) what about this:
> 
> if db_first:
>   db_flag = "w";
> else:
>   db_flag = "a";
> 
> is there a better way to write this? 
> 
Not that I can think of. The above is pretty Pythonic.

> once again ... i don't want annoy you, i just start to learn python. 
> Mainly i will use it for cgi programming. so the first thing i do is to 
> write a simple guestbook. i was surprised how easy it was ... 
> 
Yes, Python is really good for web systems.

> sorry for my bad english but i'm from germany :-)
> 
> 
Nothing wrong with your English. Glad to hear from you.

regards
 Steve
-- 
http://www.holdenweb.com/








More information about the Python-list mailing list