Strange (for a newbie) problem
secchi at sssup.it
Sun Feb 22 11:05:51 CET 2004
Thanks Alan, Peter, Wes and Josiah.
Noting that sys.argv was a string solved the problem!!!
On Sat, 21 Feb 2004 22:39:29 GMT
wes weston <wweston at att.net> wrote:
> Yes, more info is needed. One thing that could move
> your error to a latter line and confuse you is that you
> can "multiply" strings.
> >>> x='5'
> >>> print 6*x
> >>> print type(x)
> <type 'str'>
> Angelo Secchi wrote:
> > I'm experiencing the following problem.
> > 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' 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?
> > Thanks
> > angelo
Angelo Secchi PGP Key ID:EA280337
Graduate Fellow Scuola Superiore S.Anna
Piazza Martiri della Liberta' 33, Pisa, 56127 Italy
ph.: +39 050 883365
email: secchi at sssup.it www.sssup.it/~secchi/
More information about the Python-list