So I'm determined to learn programming and I decided to start with Python and ChucK (audio language) but I'm having issues running things in the cmd terminal. I get Python to open in the terminal but when I try to run a program, I always get a syntax error indicating something wrong with the filename. I also encounter problems running ChucK through the command line. I can't further my learning like this and I need to resolve this. Running windows7 and python 2.7 Thanks!
-
Paste the error that you are getting.Senthil Kumaran– Senthil Kumaran2011-07-18 04:34:11 +00:00Commented Jul 18, 2011 at 4:34
-
I'm voting to close this question as off-topic because the link in the question is no longer valid. The question was not clear and lacks details.Anthony Kong– Anthony Kong2019-07-31 03:14:50 +00:00Commented Jul 31, 2019 at 3:14
1 Answer
First of all, your link should be http://imagebin.org/163567
You're managing to run the Python interpreter, then trying to again run Python from within that interpreter. Instead of what you've done, try just C:\Python27\python democodes.py at the command line from whatever directory democodes.py is in.
Also, check out PyWin32, http://sourceforge.net/projects/pywin32
Latest 32-bit version: http://sourceforge.net/projects/pywin32/files/pywin32/Build216/pywin32-216.win32-py2.7.exe/download
It includes a GUI python interpreter and editor called PythonWin that will be easier for you to use.
11 Comments
from sys import argv script, first, second, third = argv print "The script is called:", script print "Your first variable is:", first print "Your second variable is:", second print "Your third variable is:", third the error reads: Traceback (most recent call last): File "C:\Python27\democode.py", line 3, in <module> script, first, second, third = argv ValueError: need more than 1 value to unpack i copied the example verbatim from the pdf, so i don't see why I'm getting an error there.C:\Python27\python ex13.py a b c. Python needs to be passed four arguments (the script and three more) if you're going to unpack four items from argv.