[Tutor] making executables
alan.gauld@bt.com
alan.gauld@bt.com
Mon, 19 Mar 2001 14:36:40 -0000
------_=_NextPart_001_01C0B082.02ED5840
Content-type: text/plain; charset="iso-8859-1"
Hi Cameron,
These are actually two different questions:
How do you make a python program executable
You can use various tools like Gordon McMillans installer which
will produce an executable file that will run on any PC.
so it will run independently of the GUI?
But you can run any python script independantly from IDLE or Pythonwin.
Just start an OS command prompt and type:
C:\>python myfile.py
Or even just double click myfile.py in Windows Explorer.
If you do that it may run faster than you can see in which case
either
1) put a line like raw_input("Hit Enter to exit") or
2) use a commandline flag to python which prevents it closing
at the end of the script ( I think its -i ).
HTH,
Alan G
------_=_NextPart_001_01C0B082.02ED5840
Content-type: text/html; charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 5.00.3013.2600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=260591914-19032001>Hi
Cameron,</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=260591914-19032001></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=260591914-19032001>These
are actually two different questions:</SPAN></FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
<DIV><FONT face=Arial size=2>How do you make a python program
executable <SPAN class=260591914-19032001><FONT
color=#0000ff> </FONT></SPAN></FONT></DIV></BLOCKQUOTE>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=260591914-19032001>You
can use various tools like Gordon McMillans installer which </SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=260591914-19032001>will
produce an executable file that will run on any PC.</SPAN></FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
<DIV><FONT face=Arial size=2><SPAN class=260591914-19032001> </SPAN>so it
will run independently of the GUI?</FONT></DIV>
<DIV> </DIV></BLOCKQUOTE>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=260591914-19032001>But
you can run any python script independantly from IDLE or
Pythonwin.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=260591914-19032001>Just
start an OS command prompt and type:</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=260591914-19032001></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=260591914-19032001>C:\>python myfile.py</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=260591914-19032001></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=260591914-19032001>Or
even just double click myfile.py in Windows Explorer.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=260591914-19032001>If you
do that it may run faster than you can see in which case</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=260591914-19032001>either
</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=260591914-19032001>1) put a line like raw_input("Hit Enter to exit")
or</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=260591914-19032001>2) use
a commandline flag to python which prevents it closing </SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=260591914-19032001>at the
end of the script ( I think its -i ).</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=260591914-19032001></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=260591914-19032001>HTH,</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN
class=260591914-19032001></SPAN></FONT> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=260591914-19032001>Alan
G</SPAN></FONT><FONT color=#0000ff face=Arial size=2><SPAN
class=260591914-19032001></SPAN></FONT></DIV></BODY></HTML>
------_=_NextPart_001_01C0B082.02ED5840--