This is the P2PU Archive. If you want the current site, go to www.p2pu.org!

Learn Python the Hard Way

My recent threads

You haven't posted any discussions yet.

Recently updated threads

Exercise 13...

Go back to: General discussion

Well, I have been having some trouble with running my scripts from the Windows Command Line, I just used IDLE and ran the code. Exercise 13 doesn't let you do this (you have to pass stuff in from other scripts). So I  I followed THIS TUTORIAL  about adding a path for the windows to be able to see where python is, cause everytime i tried to run python off the CMD it said it was unrecongized. So anyway. Can someone help me do this the right way???

ZM L's picture
ZM L
Tue, 2011-02-01 04:44

Well, first go into your cmd and type "python"
Usually it will get you into the python interactive shell. This is what I get by default after installing python on windows.

If it doesn't, you will need to add it to your path. you can either add it manually by computer->properties->advance settings, enviroment variables->system variables and go to PATH to add the location of your python installation C:\python27\python.exe;

another way I think is to just go to your add/remove program, find your python installation, select change installation or repair and tick "make this the default python installation". That what I see on my ActivePython installation, though I'm not sure about the default Python installation from the Python website.

Patrick Crosman's picture
Patrick Crosman
Thu, 2011-02-10 02:40

Thanks!

Paul Varty's picture
Paul Varty
Mon, 2011-03-07 06:22

I'm way behind and have now encountered a problem with Exercise 13

When I run the program I get the following error message

Traceback (most recent call last):
File "ex13.py", line 3, in
script, first, second, third = argv
ValueError: need more than 1 value to unpack

Did anyone encounter this?
Any solutions?

Thank you

Paul Varty's picture
Paul Varty
Mon, 2011-03-07 06:32

Nevermind
I'm so used to just typing up the program and running it and I didn't read the exercise in full.
I'm back in gear!.

michael chang's picture
michael chang
Sun, 2011-03-13 17:36

I'm also way behind. In the Extra Credit, how does one combine raw_input with argv?

michael chang's picture
michael chang
Sun, 2011-03-13 17:49

Never mind, lives in a different thread.