Re: [Tutor] Python and Tkinter Programming by Grayson--New Version?

2010-11-25 Thread Yves Dextraze
Sent from my iPod ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python and Tkinter Programming by Grayson--New Version?

2010-11-25 Thread Alan Gauld
"Yves Dextraze" wrote Sent from my iPod There is no mention on Amazon of any new editions and they usually announce several months in advance... A pity a new Tkinter book using Tix and ttk instead of PMW would be a really useful resource! Alan G. _

Re: [Tutor] Random Number Question

2010-11-25 Thread Timo
On 25-11-10 08:00, Mac Ryan wrote: On Thu, 25 Nov 2010 00:58:23 + Adam Bark wrote: Ah yes always avoid giving your modules names that appear in the standard library. It goes wrong, sometimes in unexpected ways. I was wondering... apart from checking each name individually, is there any ea

Re: [Tutor] Random Number Question

2010-11-25 Thread Mac Ryan
On Thu, 25 Nov 2010 11:09:10 +0100 Timo wrote: > > I was wondering... apart from checking each name individually, is > > there any easy-peasy way to get a list of names used in the > > standard library (I am thinking to something like "dir()"? > This is the webpage I always use for searchin

Re: [Tutor] Random Number Question

2010-11-25 Thread Chris Fuller
Well, you can try "import x", but your problem wasn't that you used the same filename as some Python script on your path, the problem was you then tried to import that other script. So to avoid infinite recursion, all you have to do is avoid importing your own filename, which should be easy en

Re: [Tutor] If os.path.lexists() isn't working properly

2010-11-25 Thread Susana Iraiis Delgado Rodriguez
Hi Dave! Thank you for your suggestion I haven't prevent the problems you're describing, but I'm newbie in this stuff so, where should I repalce the code? Thank you again! 2010/11/24 Dave Angel > On 01/-10/-28163 02:59 PM, Susana Iraiis Delgado Rodriguez wrote: > >> Hello Peter! >> >> I added t

Re: [Tutor] If os.path.lexists() isn't working properly

2010-11-25 Thread Dave Angel
On 11/25/2010 09:20 AM, Susana Iraiis Delgado Rodriguez wrote: Hi Dave! Thank you for your suggestion I haven't prevent the problems you're describing, but I'm newbie in this stuff so, where should I repalce the code? Thank you again! 2010/11/24 Dave Angel On 01/-10/-28163 02:59 PM, Susana Ir

Re: [Tutor] Python module structure & directories

2010-11-25 Thread Karim
Hello, I use to have it under src/lib as follow: src/lib/python src/lib/tcl src/lib/c All *.py modules are in src/lib/python with all the possible modules hierarchy. Then, At build time I copy lib root directory in the install. (with all C code compiled). Then the startup bin executable

Re: [Tutor] Python module structure & directories

2010-11-25 Thread Karim
Another possibility is to place you python library in the site package of your network installation, namely for my computer: *$HOME/build/python/src/Python-2.7.1rc1/Lib/site-packages* I build the latest release of python (rc1). But At build time I believe that the path to the libraries is har

Re: [Tutor] Random Number Question

2010-11-25 Thread Peter Otten
Alan Gauld wrote: import random > > It tries to import itself, which then tries to import itself, > which then. infinite loop time... I think it's more like - look up module random in sys.modules - module random not found in sys.modules; locate the file random.py - file random.py found

[Tutor] if syntax expression help

2010-11-25 Thread Rance Hall
I have a user entered variable that I need to check to see if they entered one of the two legal values. But I only need to check this if one other fact is true. we have a variable called "mode" whose value is either "add" or "edit" based on how we where called. we have a userentry variable tie

Re: [Tutor] if syntax expression help

2010-11-25 Thread Peter Otten
Rance Hall wrote: > I have a user entered variable that I need to check to see if they > entered one of the two legal values. > > But I only need to check this if one other fact is true. > > > we have a variable called "mode" whose value is either "add" or > "edit" based on how we where called

Re: [Tutor] if syntax expression help

2010-11-25 Thread Alan Gauld
"Rance Hall" wrote My current if statement looks like this: if ((userentry.lower != "c" or userentry.lower != "i") and mode == "add"): Peter has poinrted out one roblem but there is another. The or expression will always be true, consider: 1) The first term wi

[Tutor] for loops when there is only one row in the result - is there an alternative?

2010-11-25 Thread Rance Hall
Im using the py-postgresql module (docs here: http://python.projects.postgresql.org/docs/1.0/) in a python 3.1 environment to connect to my database. so far everything is working, but I'm having trouble understanding the structure of the variable returned by a select statement Generally you have

Re: [Tutor] for loops when there is only one row in the result - is there an alternative?

2010-11-25 Thread Steven D'Aprano
Rance Hall wrote: Generally you have something like this: clientlist = get_clients() # where get_clients is a prepared sql statement. normally you would get the individual rows like this: for row in clientlist: do stuff which is great for a long list of results. But I'm running into is

[Tutor] List Changing Order

2010-11-25 Thread Corey Richardson
Tutors, I recall that the keys of dictionaries have arbitrary order, and may change over time. Is this true of lists? I can't find the answer from a simple Google search. Thank you! ___ Tutor maillist - Tutor@python.org To unsubscribe or change sub

Re: [Tutor] List Changing Order

2010-11-25 Thread James Mills
On Fri, Nov 26, 2010 at 1:47 PM, Corey Richardson wrote: > I recall that the keys of dictionaries have arbitrary order, and may change > over time. Is this true of lists? I can't find the answer from a simple > Google search. Thank you! items append to a list retain their order. cheers James --

Re: [Tutor] List Changing Order

2010-11-25 Thread Steven D'Aprano
Corey Richardson wrote: Tutors, I recall that the keys of dictionaries have arbitrary order, and may change over time. Is this true of lists? I can't find the answer from a simple Google search. Thank you! Only if you re-arrange it yourself. list.sort(), list.reverse() and random.shuffle(li