[Tutor] How to run a python script

2016-02-20 Thread Erol Gericke
I want learn Python programming. Many years ago I taught myself BASIC so 
I have some programming experience.


I have  installed Python 2.7.11 and Notepad ++ on my Win 7 computer. I 
have also edited the PATH variable to include C:\Python27.


However I am unable to run any scripts.

When I type (into the COMMAND PROMPT window) python test.py or
python C:\python27\test.py  I get SyntaxError: invalid syntax

Until I solve this problem learning programming makes no sense.

Can you please help me, I would appreciate your help.

Thank you in advance,
Erol Gericke.
Somerse West. South Africa.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to run a python script

2016-02-21 Thread Erol Gericke

Thanks again
Erol

On 2016/02/21 11:10 AM, Chris Warrick wrote:

Forwarding to mailing list, please use Reply All in the future.

On 21 February 2016 at 09:48, Erol Gericke  wrote:

Hi Chris,

Thanks for your prompt reply, the problem has been solved!
I was using the 'python' terminal not the 'DOS' terminal.

  I have created a new directory to hold the *.py scripts.

As I type with only two fingers I want to keep everything as short as
possible.
Is there a way to avoid the full path when running a script.

Thanks again, you have revived my interest in Python.

Regards,
Erol Gericke



Please paste the full error message, and your complete source code.
Also, make sure you are running the commands in the regular command
prompt window, and not in a Python-specific one.

Also, your scripts should not live in C:\Python27, because they might
conflict with other things.


You can open command prompt in the directory of your scripts [0] or
put them in a directory that doesn’t require a lot of typing (C:\py
for example).

PS. it’s not the “DOS” terminal, it’s the command prompt (cmd.exe).
DOS is not part of Windows NT/2000/XP and better, and rightfully so.

[0]: In Windows 8?/10, available from the File menu. Otherwise:
http://www.askvg.com/enable-open-command-window-here-option-in-context-menu-in-windows-vista/



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