I just started using Python yesterday and have already ran into a few walls. I'm using a tutorial by Alan Gauld and at first everything worked fine. It wasn't until I came to the part about running your python program through the window's command prompt that i ran into an issue... I finally found out how you make python run using the command prompt (Editing the Path in Environmental Variables), but I have yet figured out how to make my simple program execute. Any help at all would be greatly appreciated. Maybe I should use a different tutorial (one specific to Vista)? Thanks for your time.
Say you make a file on your desktop called test.py with the text:
Then open the console and type:Code:print('hi!')
So that it display something like:Code:cd desktop
Then you can run your file by typing either:C:\Users\PythonPower\Desktop>
Code:python test.py
Code:python3 test.py
Thanks for the advice, but i won't be able to try it out until I get home, I'm at work right now lol.
ok so I finally had time to try it out and when I type cd desktop in my command prompt I get the following message.
The system cannot find the path specified.
The spelling is correct and typed exactly how you typed it... So what did I do wrong?
Try writing this on the command prompt "set path=%path%;C:\python26".
You might have to navigate to the directory which contains it first.. I know that's how it's done in ubuntu anyway. You can't ./filename.pyc unless you're in the directory which contains the program.. like I said, that's how it goes with ubuntu (I think? I'm still quite new with ubuntu, there may be a way..) but I don't have any experience with Python on a Windows OS.
EDIT: Ignore my post.. I didn't realise your error was from 'cd desktop'
well when i use python off command prompt (which i do rarely) i usually do the regular run as... , CMD, then i type python in the Command Prompt then usually it comes up with___ Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information.___
and then the usual >>> where i can just put print "hello world"
however for some reason i don't think i'm getting the nature of your question just right...
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks