Learn Python the hard way Exercise 13 error -
every time run program "valueerror: need more 1 variable." i'm doing zed says running ex13.py first 2nd 3rd
. don't need type python
in terminal before filename because computer recognizes python files. i'm on windows 7 , using python 2.7. appreciated. i've tried popular answer in thread: valueerror: need more 1 value unpack , i'm still getting same error. appreciated
from sys import argv script, first, second, third = argv print "the script called:", script print "your first variable is:", first print "your second variable is:", second print "your third variable is:", third
edit: here's error i'm getting: traceback (most recent call last): file "c:\users\ian\lpthw\ex13.py", line 3, in script, first, second, third = argv valueerror: need more 1 value unpack
it's winston ewert said in comments. have tell system where's python
, otherwise won't able run script properly. example, in linux/unix achieve using shebang pointing python
executable, #!/usr/bin/python
, or running script python your_script
. try running command using python ex13.py first 2nd 3rd
, see works.
as on windows, here's how configure python on it:
3.3. configuring python
3.3.1. excursus: setting environment variables
3.3.2. finding python executable
3.3.3. finding modules
3.3.4. executing scripts
Comments
Post a Comment