srtring to int question

Jim Richardson warlock at eskimo.com
Sat Aug 12 21:26:41 EDT 2000


For various reasons, I have written a small bit of python code to
take a 1-3 julian day, and return the day-month form. It works
ok mostly (available at http://www.eskimo.com/~warlock/freesoft/julian_py.tgz)
 OK, the question, I use raw_input to poll for the julian day, and 
then convert to int via int, but how do I check that the value from raw_input
is "intable"? that is, it works fine if I pass a number, but if I type in
non-numerical characters, [a-zA-Z!@# etc] then the code errors on the
int() function. Any pointers? thanks

-- 
Jim Richardson
	Anarchist, pagan and proud of it
WWW.eskimo.com/~warlock
	Linux, because life's too short for a buggy OS.




More information about the Python-list mailing list