summaryrefslogtreecommitdiffstats
path: root/Doc/tut
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2003-07-07 21:00:29 (GMT)
committerFred Drake <fdrake@acm.org>2003-07-07 21:00:29 (GMT)
commitdfda8d79ee0a1eabdcbda8648681fb2bf42a81e5 (patch)
tree66f299c32f1088777694402808cce5d1a0a2233d /Doc/tut
parent84261d2f1337781f2d8fec8af898c38165c78ee2 (diff)
downloadcpython-dfda8d79ee0a1eabdcbda8648681fb2bf42a81e5.zip
cpython-dfda8d79ee0a1eabdcbda8648681fb2bf42a81e5.tar.gz
cpython-dfda8d79ee0a1eabdcbda8648681fb2bf42a81e5.tar.bz2
- explain about making Python scripts executable on Unix in more
detail - fix minor markup nit
Diffstat (limited to 'Doc/tut')
-rw-r--r--Doc/tut/tut.tex15
1 files changed, 13 insertions, 2 deletions
diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex
index d78b112..d38534b 100644
--- a/Doc/tut/tut.tex
+++ b/Doc/tut/tut.tex
@@ -299,13 +299,24 @@ 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} % $ <-- bow to font-lock
+
+
\subsection{Source Code Encoding}
-It is possible to use encodings different than ASCII in Python source
+It is possible to use encodings different than \ASCII{} in Python source
files. The best way to do it is to put one more special comment line
right after the \code{\#!} line to define the source file encoding: