Re: [Tutor] Defining functions

2005-03-27 Thread Kent Johnson
- print is just being changed to a function (instead of a statement), it's not going away entirely. But for complete future compatibility I guess you would avoid it. - I don't think you will ever get the prompt as part of the input unless the user actually types it - You can strip the trailing

Re: [Tutor] Running a python script from another python script

2005-03-27 Thread Kent Johnson
M.Sinan ORUN wrote: Hello, I am a newbee in python and trying to make a small script for my school project . I try to run a python cgi script from another phyton script as a result of an action . What is the neccesary command for this action and is there a special class have to be imported for

[Tutor] hash()ing a list

2005-03-27 Thread Orri Ganel
Hello all, While I do not have a pressing need to hash a list, I am curious as to why, if lists are unhashable, there is a __hash__() method in the list class, which also does not work on lists, but results in a 'TypeError: list objects are unhashable'. What's the point of including a __hash__()

Re: [Tutor] re question

2005-03-27 Thread Jacob S.
Kent -- when pulling out just the numbers, why go to the trouble of splitting by , first? import re pat = re.compile(r[^\d.]*) t = SigWind: 857hPa, , 21.0C, 20.1C, 210 @ 9kts SigWind: 850hPa±, , , , 205 @ 11kts Std Lvl: 850hPa, 1503m, 16.8C, 15.7C, 205 @

Re: [Tutor] hash()ing a list

2005-03-27 Thread Danny Yoo
On Sun, 27 Mar 2005, Orri Ganel wrote: While I do not have a pressing need to hash a list, I am curious as to why, if lists are unhashable, there is a __hash__() method in the list class, which also does not work on lists, but results in a 'TypeError: list objects are unhashable'. What's

[Tutor] unhashable objects (unrelated to previous topic)

2005-03-27 Thread Orri Ganel
Hello all, I am attempting to implement a LinkedList in Python, and in doing so, have created a Node class which represents the elements of the LinkedList. However, since these Nodes have custom-defined __lt__(), __gt__(), __le__(), __ge__(), __eq__(), and __ne__() methods, they are, for some

Re: [Tutor] hash()ing a list

2005-03-27 Thread Orri Ganel
So, any class that has 'rich comparison methods' defined is unhashable? What gives? (See '[Tutor] unhashable objects') On Sun, 27 Mar 2005 12:38:09 -0800 (PST), Danny Yoo [EMAIL PROTECTED] wrote: On Sun, 27 Mar 2005, Orri Ganel wrote: While I do not have a pressing need to hash a list,

[Tutor] How and where to use pass and continue

2005-03-27 Thread Kevin
I am having lot of trouble learning where and when to use pass and continue. The two books that I use don't explian these very good. Is there a website the explains these is great detail? I have also looked at the python tutorial as well. Thanks Kevin

Fwd: [Tutor] How and where to use pass and continue

2005-03-27 Thread Liam Clarke
Oops, forward to list as well. -- Forwarded message -- From: Liam Clarke [EMAIL PROTECTED] Date: Mon, 28 Mar 2005 14:22:00 +1200 Subject: Re: [Tutor] How and where to use pass and continue To: Kevin [EMAIL PROTECTED] Hi Kevin, I generally use pass as a placeholder - if you

Re: [Tutor] How and where to use pass and continue

2005-03-27 Thread Sean Perry
Kevin wrote: I am having lot of trouble learning where and when to use pass and continue. The two books that I use don't explian these very good. Is there a website the explains these is great detail? I have also looked at the python tutorial as well. language idioms are one of the hardest things

Re: [Tutor] How and where to use pass and continue

2005-03-27 Thread Bill Mill
On Sun, 27 Mar 2005 20:37:02 -0500, Kevin [EMAIL PROTECTED] wrote: I am having lot of trouble learning where and when to use pass and continue. The two books that I use don't explian these very good. Is there a website the explains these is great detail? I have also looked at the python

Re: [Tutor] How and where to use pass and continue

2005-03-27 Thread Kevin
That was a great help I understand now what they do and how to use them. Thanks alot for all your help. On Sun, 27 Mar 2005 21:43:45 -0500, Bill Mill [EMAIL PROTECTED] wrote: On Sun, 27 Mar 2005 20:37:02 -0500, Kevin [EMAIL PROTECTED] wrote: I am having lot of trouble learning where and when

Re: [Tutor] How and where to use pass and continue

2005-03-27 Thread Kevin
Ok I have another question now I noticed that at the tope of a while loop there will be somthing like this: test = None while test != enter: test = raw_input(Type a word: ) if test == enter: break what is the purpose of test = None ? Thanks Kevin On Sun, 27 Mar

Re: [Tutor] unhashable objects (unrelated to previous topic)

2005-03-27 Thread Kent Johnson
Orri Ganel wrote: Thanks to Jeff and John Fouhy . . . However, my question now is: can I treat Nodes sometimes the same and sometimes not? I want to treat Nodes whose cargo is the same the same everywhere *except* in a dictionary, because I want the user to be able to use LinkedList in a broader

Re: [Tutor] How and where to use pass and continue

2005-03-27 Thread Kent Johnson
Kevin wrote: Ok I have another question now I noticed that at the tope of a while loop there will be somthing like this: test = None while test != enter: test = raw_input(Type a word: ) if test == enter: break what is the purpose of test = None ? Otherwise you will