Strange side effect from reading a list of numbers from argv
Jeff Epler
jepler at inetnebr.com
Sun Jul 18 18:29:02 EDT 1999
On Sun, 18 Jul 1999 21:55:58 GMT, Harold Gottschalk
<heg at softbrew.com> wrote:
>I just wrote this program to become familiar with python and I do not
>understand why it works with a list I create with in the program and not
>when I use sys.argv[1:].
try it with
for value in map(int, sys.argv[1:]):
or else you're working with strings. It's come up before that "string <
int" doesn't cause an exception, but I don't remeber what the good reason
for it was.
Jeff
--
\/ http://www.infidels.org/ Jeff Epler jepler at inetnebr.com
Ask yourself whether you are happy and you cease to be so.
-- John Stuart Mill
More information about the Python-list
mailing list