Re: Coding style

2006-07-17 Thread dwelch91
PTY wrote: > Which is better? > > lst = [1,2,3,4,5] > > while lst: > lst.pop() > > OR > > while len(lst) > 0: > lst.pop() > I think the first one is better, but if all you are doing is removing all the items in the list, this is definitely better: lst = [] -Don -- http://mail.python.o

Re: Coding style

2006-07-17 Thread dwelch91
tac-tics wrote: > > I'd say the second one. Empty lists are not false. They are empty. Long > live dedicated boolean data types. > Uh, no, empty lists are False in a boolean context: http://docs.python.org/lib/truth.html -Don -- http://mail.python.org/mailman/listinfo/python-list

Re: Howto Determine mimetype without the file name extension?

2006-07-19 Thread dwelch91
Try this: http://www.demonseed.net/~jp/code/magic.py -- http://mail.python.org/mailman/listinfo/python-list

Re: is there an easy way to create a database on the fly and let the user input values

2006-10-13 Thread dwelch91
[EMAIL PROTECTED] wrote: > I don't realy care what database I use wx.grid or whatever. I > wan't it to look at a line > > 128 9023 23428 exc and create the database or pick something out of the > file as some sort of a descrition line and then display and allow the > user to change and add

Re: Yield

2006-11-15 Thread dwelch91
Mateuszk87 wrote: > Hi. > > may someone explain "yield" function, please. how does it actually work > and when do you use it? > > thanks in forward > > mateusz > http://docs.python.org/ref/yield.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Best Python Editor

2006-06-01 Thread dwelch91
Maric Michaud wrote: > Le Mercredi 31 Mai 2006 12:03, Manoj Kumar P a écrit : >> Hi, >> >> Can anyone tell me a good python editor/IDE? >> It would be great if you can provide the download link also. > > I didn't see on this list much PyQT users, is there a consensus about it ? > > I vote for lin

Tkinter and dialogs

2006-07-06 Thread dwelch91
I'm trying unsuccessfully to do something in Tk that I though would be easy. After Googling this all day, I think I need some help. I am admittedly very novice with Tk (I started with it yesterday), so I am sure I am overlooking something simple. The basic idea is that my application will consi

Detecting 64bit vs. 32bit Linux

2006-07-07 Thread dwelch91
I need to detect whether the operating system I am running on (not the Python version) is 64bit or 32bit. One requirement is that I need to include support for non-Intel/AMD architectures. The 2 ways I have thought detecting 64bit are: 1. struct.calcsize("P") == 8 2. '64' in os.uname()[4] I'm