Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues > Python

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-23-2011, 02:37 AM   PM User | #1
Alexcny
New to the CF scene

 
Join Date: Dec 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Alexcny is an unknown quantity at this point
Newb Python Problem

I've decided that I wanted to learn some programming basics. I started by using this guide http://learnpythonthehardway.org/book/index.html

It took me an embarrassingly long time to get through exercise 0 which is getting python installed and running.

I moved to exercise 1 http://learnpythonthehardway.org/book/ex1.html and am failing miserably. The step tells you to create a basic code using the print command. It doesn't say what program to use to write this but I'm assuming its gedit, which the tutorial asked me to install earlier.

It says to save that file as ex1.py but does not list what directory I should save this in. I saved the code in a folder I created in my personal folder.

When I try to run this program in the terminal I get an error message that python cannot run the file because of [errno 2] No such file or directoy.

I'm guessing this has to do with how I'm saving the code but I am stumped.

Any help would be greatly, greatly appreciated.

Thanks in advance!
Alexcny is offline   Reply With Quote
Old 12-23-2011, 03:53 PM   PM User | #2
Apothem
Regular Coder

 
Apothem's Avatar
 
Join Date: Mar 2008
Posts: 380
Thanks: 36
Thanked 25 Times in 25 Posts
Apothem is an unknown quantity at this point
Simple questions/requests: What did you run in your terminal? Where is your file located?
Apothem is offline   Reply With Quote
Old 12-23-2011, 06:29 PM   PM User | #3
Alexcny
New to the CF scene

 
Join Date: Dec 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Alexcny is an unknown quantity at this point
The file I created is located at

C:/Users/me/PythonFiles

The file is saved as ex1.py

In the terminal I type python ex1.py which is what the guide I was following says to do. I'm guessing python can't locate the file ex1.py.

Forgot to mention I'm running this on Windows 7.

I've taken all the steps to make sure python is working just can't get this specific program to run.
Alexcny is offline   Reply With Quote
Old 12-23-2011, 08:02 PM   PM User | #4
Apothem
Regular Coder

 
Apothem's Avatar
 
Join Date: Mar 2008
Posts: 380
Thanks: 36
Thanked 25 Times in 25 Posts
Apothem is an unknown quantity at this point
Type in the command line:
dir

And see if your file is there. You might not have cd'd to the right directory / your file editing program may have added an unwanted extension to the python file.
Apothem is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:44 PM.


Advertisement
Log in to turn off these ads.