Strange (for a newbie) problem

Alan Gauld alan.gauld at btinternet.com
Sat Feb 21 14:19:42 EST 2004


On Sat, 21 Feb 2004 18:15:35 +0100, Angelo Secchi
<secchi at sssup.it> wrote:
> I have a python script analyses.py where a certain point I have to
> define a variable called 'code' like:
> 
> code=151
> 
> The program works fine but if I change that line in 'code=sys.argv[1]'
> using the sys module in order to give to the program that code as a
> parameter (i.e. I then run this script as "python analyses.py 151" from
> the shell) then the program returns an error complaining that a certain
> variable different from code is not defined.
> 
> What is my mistake?

Dunno. You need to give us more information. Without seeing where
the error occurs, how the other variable is both defined and
used, we cannot guess what you might be doing! Well, we could
guess but its not likely to be very profitable!

Alan G.
Author of the Learn to Program website
http://www.freenetpages.co.uk/hp/alan.gauld



More information about the Python-list mailing list