Re: [Tutor] Python Trouble, Please Help!

2013-08-08 Thread Alan Gauld

On 25/07/13 00:23, Jonathan Hong wrote:


because of my lack of computer knowledge. When I do put in python
helloworld.py into the command prompt line, the computer gives me a
response of: python: can't open file 'hello.py': [Errno 2] No such file


You need to supply the full path to the file (or be in the same 
directory as the file) when you try to run it.


Mostly on Windows you can run scripts from Windows explorer but for 
simple scripts (like hello world) the window appears and then 
dissappears too quickly to see it. You can most easily get around that 
by putting one of:


raw_input(Hit Enter to quit)   # for Python v2

input(Hit Enter to quit)   # for Python v3


as the last line in your script.

You might find that technique easier than using the CMD window.
But the CMD window is better when things go wrong - it lets you see any 
error messages,...


--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Python Trouble, Please Help!

2013-08-07 Thread Jonathan Hong
Hello,

I am currently working with the Python programming language and had a very
basic question regarding the start up of Python. For some reason, when I
open up the Command Prompt in my Windows 7 computer, I am unable to access
python files. So when I type in the python command, I am able to start
writing in python, but I cannot call other python files such as saying python
helloworld.py. I think it might have something to do with where I am
placing my files and the path of python? Not too sure though because of my
lack of computer knowledge. When I do put in python helloworld.py into the
command prompt line, the computer gives me a response of: python: can't
open file 'hello.py': [Errno 2] No such file or directory. I know for a
fact that there does exist a file called hello.py though.
Please help me if you can!

Sincerely,
Python_Beginner
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python Trouble, Please Help!

2013-08-07 Thread Walter Prins
Hi,


On 25 July 2013 00:23, Jonathan Hong jayhong...@gmail.com wrote:

 Hello,

 I am currently working with the Python programming language and had a very
 basic question regarding the start up of Python. For some reason, when I
 open up the Command Prompt in my Windows 7 computer, I am unable to access
 python files.


I'd like to add the following suggestion to the link Antonio's already sent
you:
http://www.voidspace.org.uk/python/articles/command_line.shtml


Regards,

Walter
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor