Running a python program as main...

W

waltbrad

Stumbling through Mark Lutz's "Programming Python 3rd", he gives an
example of a program that will automatically configure environment
settings and launch other programs. Then he gives an example of
running this program. On his command line he types:

C:\...\PP3E>Launcher.py

and this begins the program. Doesn't work for me. I have to type:

C:\...\PP3E>python Launcher.py

Is this a typo on his part or has he configured his settings in such a
way that the command line will automatically associate the extension
with the program? (If so, he didn't mention this in his book).
 
G

Gabriel Genellina

Stumbling through Mark Lutz's "Programming Python 3rd", he gives an
example of a program that will automatically configure environment
settings and launch other programs. Then he gives an example of
running this program. On his command line he types:

C:\...\PP3E>Launcher.py

and this begins the program. Doesn't work for me. I have to type:

C:\...\PP3E>python Launcher.py

Is this a typo on his part or has he configured his settings in such a
way that the command line will automatically associate the extension
with the program? (If so, he didn't mention this in his book).

I think it is an option in the installer, to associate or not Python to
the .py extension.
You could reinstall Python paying attention to the options, or repair the
association as described in this thread:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/b1d0fd05b3615057/
 
R

Robert Lehmann

I think it is an option in the installer, to associate or not Python to
the .py extension.
You could reinstall Python paying attention to the options, or repair
the association as described in this thread:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/
b1d0fd05b3615057/


See also the official (development version of the) documentation with the
new section "Using Python". "Using Python on Windows" covers exactly this
topic:
http://docs.python.org/dev/using/windows.html#executing-scripts

HTH,
 
S

subeen

Stumbling through Mark Lutz's "Programming Python 3rd", he gives an
example of a program that will automatically configure environment
settings and launch other programs. Then he gives an example of
running this program. On his command line he types:

C:\...\PP3E>Launcher.py

and this begins the program. Doesn't work for me. I have to type:

C:\...\PP3E>python Launcher.py

Is this a typo on his part or has he configured his settings in such a
way that the command line will automatically associate the extension
with the program? (If so, he didn't mention this in his book).

You have to set the path in your run time environment.

regards,
Subeen.
http://love-python.blogspot.com/
 
R

Rick Dooling

On his command line he types:

C:\...\PP3E>Launcher.py

and this begins the program. Doesn't work for me. I have to type:

C:\...\PP3E>python Launcher.py

Is this a typo on his part or has he configured his settings in such a
way that the command line will automatically associate the extension
with the program? (If so, he didn't mention this in his book).

Browse this thread on clp:

http://tinyurl.com/2wbnde

RD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top