0

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!

![1]: http://imagebin.org/index.php?mode=image&id=163567

2
  • Paste the error that you are getting. Commented 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. Commented Jul 31, 2019 at 3:14

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

11 Comments

thanks for the reply. i'm looking into your suggestions. I'm still getting the same error when I run a .py file the way you recommend. It's not just a python issue, (though it certainly is a big issue) it's also when I try to run ChucK through the terminal. So I think it's a bigger problem
The error your getting is because you're trying to run it inside the Python interpreter, not just in the terminal. What happens when you just open a terminal (NOT a Python interpreter) and run the command? Edit: If there is another error than the one you screenshotted, please add it.
I'm trying to run exercise 13 through the IDLE GUI which is 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.
of course the code is a mess because I can't skip lines. pictures to follow soon edit: sheddingbikes.com/LearnPythonTheHardWay.pdf
For that to work, you need to run something like 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.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.