Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dfda8d7

Browse files
committed
- explain about making Python scripts executable on Unix in more
detail - fix minor markup nit
1 parent 84261d2 commit dfda8d7

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

Doc/tut/tut.tex

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,13 +299,24 @@ \subsection{Executable Python Scripts \label{scripts}}
299299

300300
(assuming that the interpreter is on the user's \envvar{PATH}) at the
301301
beginning of the script and giving the file an executable mode. The
302-
\samp{\#!} must be the first two characters of the file. Note that
302+
\samp{\#!} must be the first two characters of the file. On some
303+
platforms, this first line must end with a \UNIX-style line ending
304+
(\character{\e n}), not a Mac OS (\character{\e r}) or Windows
305+
(\character{\e r\e n}) line ending. Note that
303306
the hash, or pound, character, \character{\#}, is used to start a
304307
comment in Python.
305308

309+
The script can be given a executable mode, or permission, using the
310+
\program{chmod} command:
311+
312+
\begin{verbatim}
313+
$ chmod +x myscript.py
314+
\end{verbatim} % $ <-- bow to font-lock
315+
316+
306317
\subsection{Source Code Encoding}
307318

308-
It is possible to use encodings different than ASCII in Python source
319+
It is possible to use encodings different than \ASCII{} in Python source
309320
files. The best way to do it is to put one more special comment line
310321
right after the \code{\#!} line to define the source file encoding:
311322

0 commit comments

Comments
 (0)