(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.
+\samp{\#!} must be the first two characters of the file. Note that
+the hash, or pound, character, \character{\#}, is used to start a
+comment in Python.
\subsection{The Interactive Startup File \label{startup}}
presence or absence of prompts (\samp{>>> } and \samp{... }): to repeat
the example, you must type everything after the prompt, when the
prompt appears; lines that do not begin with a prompt are output from
-the interpreter.%
+the interpreter. %
%\footnote{
% I'd prefer to use different fonts to distinguish input
% from output, but the amount of LaTeX hacking that would require
Note that a secondary prompt on a line by itself in an example means
you must type a blank line; this is used to end a multi-line command.
+Many of the examples in this manual, even those entered at the
+interactive prompt, include comments. Comments in Python start with
+the hash character, \character{\#}, and extend to the end of the
+physical line. A comment may appear at the start of a line or
+following whitespace or code, but not within a string literal. A hash
+character within a string literal is just a hash character.
+
+Some examples:
+
+\begin{verbatim}
+# this is the first comment
+SPAM = 1 # and this is the second comment
+ # ... and now a third!
+STRING = "# This is not a comment."
+\end{verbatim}
+
+
\section{Using Python as a Calculator \label{calculator}}
Let's try some simple Python commands. Start the interpreter and wait