Re: general coding issues - coding style...

2006-02-21 Thread calmar
On 2006-02-20, JW <[EMAIL PROTECTED]> wrote: Hi JW, > About this line: > 1585 if sys.path[0][-12:] == "\library.zip": #for py2exe > > pl... suggested: > if sys.path[0].endswith( "\\library.zip" ): > > > print "\\library.zip" > Yeah, I have two backslashes, but thaks for pointing out. > If you

Re: general coding issues - coding style...

2006-02-20 Thread JW
About this line: 1585 if sys.path[0][-12:] == "\library.zip": #for py2exe pl... suggested: if sys.path[0].endswith( "\\library.zip" ): and said, "did you really mean one back-slash there?". You responded "yeah, one backslash", but I still don't believe you. In this case, it happens to work, bu

Re: general coding issues - coding style...

2006-02-20 Thread calmar
On 2006-02-19, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: Bonjour, > > 1/ learn OO and get rid of globals. Well I created two classes now. I put some things global (your point 6). e.g. if it's on Windows or not, and other things. > 2/ use dict or list based dispatch instead of long if/elif/

Re: general coding issues - coding style...

2006-02-19 Thread Bruno Desthuilliers
calmar a écrit : > Hi all, > > since I'm just a 'handicraft'/beginner or so, > > could anybody provide me with some (rough) hints, about how to enhance the > code > here: > > http://calmar.ws/tmp/cal.html 1/ learn OO and get rid of globals. 2/ use dict or list based dispatch instead of long if

Re: general coding issues - coding style...

2006-02-19 Thread calmar
On 2006-02-18, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi, > 1585 if sys.path[0][-12:] == "\library.zip": #for py2exe > if sys.path[0].endswith( "\\library.zip" ): cool, thx, > (did you really mean one back-slash there?) (yeah, one backslash) > 499 tuple = os.path.split(filename) >

Re: general coding issues - coding style...

2006-02-19 Thread calmar
On 2006-02-18, Justin Azoff <[EMAIL PROTECTED]> wrote: Hi all, > Dylan Moreland wrote: >> I would look into one of the many Vim scripts which automatically fold >> most large blocks without the ugly {{{. > > Who needs a script? > "set foldmethod=indent" > works pretty well for most python progra

Re: general coding issues - coding style...

2006-02-18 Thread Justin Azoff
Dylan Moreland wrote: > I would look into one of the many Vim scripts which automatically fold > most large blocks without the ugly {{{. Who needs a script? "set foldmethod=indent" works pretty well for most python programs. -- http://mail.python.org/mailman/listinfo/python-list

Re: general coding issues - coding style...

2006-02-18 Thread Dylan Moreland
calmar wrote: > On 2006-02-18, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > > - why are these {{{ thingies there? > > markers for folding for vim > http://www.calmar.ws/tmp/sc.png I would look into one of the many Vim scripts which automatically fold most large blocks without the ugly {{{. --

Re: general coding issues - coding style...

2006-02-18 Thread plahey
Hi, 1585 if sys.path[0][-12:] == "\library.zip": #for py2exe how about if sys.path[0].endswith( "\\library.zip" ): (did you really mean one back-slash there?) 499 tuple = os.path.split(filename) bad variable name... tuple(x) converts a sequence to a tuple. You have a number of places

Re: general coding issues - coding style...

2006-02-18 Thread calmar
On 2006-02-18, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: Hi Diez, > - why are these {{{ thingies there? markers for folding for vim http://www.calmar.ws/tmp/sc.png > - use string interpolation like "Foo %s %i" % ("bar", 1) instead of > concatenating strings. I see, get's shorter and so,

Re: general coding issues - coding style...

2006-02-18 Thread Diez B. Roggisch
calmar schrieb: > Hi all, > > since I'm just a 'handicraft'/beginner or so, > > could anybody provide me with some (rough) hints, about how to enhance the > code > here: - why are these {{{ thingies there? - use string interpolation like "Foo %s %i" % ("bar", 1) instead of concatenating s

general coding issues - coding style...

2006-02-18 Thread calmar
Hi all, since I'm just a 'handicraft'/beginner or so, could anybody provide me with some (rough) hints, about how to enhance the code here: http://calmar.ws/tmp/cal.html Cheers and thanks a lot calmar -- calmar (o_ It rocks: LINUX + Command-Line-Interface //\