Gurus, I wonder if you can take a look at this source code? Win32...

G. Willoughby sab at NOSPAM.freeuk.com
Sun Mar 10 05:47:52 EST 2002


Thanks  :)

G. Willoughby

"Gerhard Häring" <gerhard at bigfoot.de> wrote in message
news:slrna8lkjk.7hm.gerhard at lilith.my-fqdn.de...
> G. Willoughby wrote in comp.lang.python:
> > Hi,
> >     I have started writing a text editor for Win32 platforms
>
> It works fine on Linux simply by not importing win32api. As far as I
> can see, you could easily remove all uses of win32api functions. Is it
> really needed for tooltips, for example?
>
> > and i wonder if anyone has a few minutes spare just to take a look
> > at the source code and give me a little constructive critisism?
>
> I didn't find much to critizize :-)
>
> I've seen this bad practise several times:
>
> try:
>     # something
> except:
>     pass
>
> A better way to do this is to only catch the exceptions that can be
> caught there, like IOError or whatever. Catching all exceptions makes
> the code difficult to debug and can hide errors for a long time. It's
> also a good practise to not only "pass", but log the errors to a
> logfile, or simply write the exception to stderr.
>
> Gerhard
> --
> mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
> web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id AD24C930
> public key fingerprint: 3FCC 8700 3012 0A9E B0C9  3667 814B 9CAA AD24 C930
> reduce(lambda x,y:x+y,map(lambda
x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))





More information about the Python-list mailing list