RE: A question about string and float number

2008-08-06 Thread Tyler Breisacher
It's generally a bad idea to use "except" without naming a specific exception. The exception you might expect in this case is ValueError. Any other exception *should* be uncaught if it happens. By the way, this method will return true for integers as well as floats. For example, isFloat('3') wi

Re: What Python looks like

2008-08-05 Thread Tyler Breisacher
To paraphrase this video (http://www.youtube.com/watch?v=zJOS0sV2a24) (which is the Randall Munroe, author of the famous xkcd (http://www.xkcd.com/), giving a talk at Google), "you just type the pseudo-code and it runs! And as someone said, if Python is executable pseudo-code, then Perl is exec

Re: I donä't get while-loops

2008-08-02 Thread Tyler Breisacher
You're actually calling the read2() function from within read2(). This is called recursion, and it is *not* what you want in this case, since it unnecessarily fills up your call stack. Remember that a while loop automatically goes back to the top without you having to re-call your function. I w