Python code is not running -
i reading learn python hard way zed a. shaw. in chapter 13 got following code
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 :",third)
i tried run on spyder error occurs.i gonna paste last lines of spyder console valueerror: not enough values unpack (expected 4, got 1)
please me figure out issue, thanks.
you aren't passing in command line arguments when run script, though it's expecting 3 arguments. you're getting error because you're trying extract more values out of args
contains.
command line arguments data you're giving program. pass dummy data arguments when run script:
python your_script_here.py 1 2 3
the 1 2 3
arguments being passed.
my example modified this tutorial. it's worth read-over.
Comments
Post a Comment