]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
- explain about making Python scripts executable on Unix in more
authorFred Drake <fdrake@acm.org>
Mon, 7 Jul 2003 21:01:09 +0000 (21:01 +0000)
committerFred Drake <fdrake@acm.org>
Mon, 7 Jul 2003 21:01:09 +0000 (21:01 +0000)
  detail

Doc/tut/tut.tex

index 0c5cc2ae8908ebad86629ea31190292636364bc3..b6c93d165d2134c0da2913c370a6c70955144ca2 100644 (file)
@@ -299,10 +299,21 @@ executable, like shell scripts, by putting the line
 
 (assuming that the interpreter is on the user's \envvar{PATH}) at the
 beginning of the script and giving the file an executable mode.  The
-\samp{\#!} must be the first two characters of the file.  Note that
+\samp{\#!} must be the first two characters of the file.  On some
+platforms, this first line must end with a \UNIX-style line ending
+(\character{\e n}), not a Mac OS (\character{\e r}) or Windows
+(\character{\e r\e n}) line ending.  Note that
 the hash, or pound, character, \character{\#}, is used to start a
 comment in Python.
 
+The script can be given a executable mode, or permission, using the
+\program{chmod} command:
+
+\begin{verbatim}
+% chmod +x myscript.py
+\end{verbatim}
+
+
 \subsection{The Interactive Startup File \label{startup}}
 
 % XXX This should probably be dumped in an appendix, since most people