[Pythonmac-SIG] Running Python scripts without full paths

Neil Mayhew niel_mayhew@mac.com
Sat, 30 Nov 2002 09:06:42 -0700


> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--Boundary_(ID_rDJT56v7D7RWz8+KgS1ngg)
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT

Paul,

If you put #!/usr/bin/python as the first line of your scripts, then you can
just type the name of the script at the command line -- no need to put
python in front. Then the shell will find the script using the PATH
environment variable. The shell will know to run it using python because of
the first line. However, you will have to give the script execute
permission, using chmod a+x <script>, or via the Finder's Get Info.

HTH,

--Neil



--Boundary_(ID_rDJT56v7D7RWz8+KgS1ngg)
Content-type: text/html; charset=US-ASCII
Content-transfer-encoding: 7BIT

<HTML>
<HEAD>
<TITLE>Re: [Pythonmac-SIG] Running Python scripts without full paths</TITLE>
</HEAD>
<BODY>
<FONT FACE="Arial">Paul,<BR>
<BR>
If you put #!/usr/bin/python as the first line of your scripts, then you can just type the name of the script at the command line -- no need to put python in front. Then the shell will find the script using the PATH environment variable. The shell will know to run it using python because of the first line. However, you will have to give the script execute permission, using chmod a+x &lt;script&gt;, or via the Finder's Get Info.<BR>
<BR>
HTH,<BR>
<BR>
--Neil<BR>
<BR>
</FONT>
</BODY>
</HTML>


--Boundary_(ID_rDJT56v7D7RWz8+KgS1ngg)--