Roy Smith wrote:
In article <[email protected]>, [email protected] wrote:What's the Pythonic way to determine if a string is a number? By number I mean a valid integer or float.try: int(myString)
It could be a float, so:
float(myString)
This will work even if it's an int.
except ValueError: print "That's bogus, man"
-- http://mail.python.org/mailman/listinfo/python-list
