Skip to content

Commit b33f3b1

Browse files
committed
several textual improvements
1 parent b1dc04d commit b33f3b1

File tree

16 files changed

+266
-188
lines changed

16 files changed

+266
-188
lines changed

text/main/basics/gettingStarted/firstProgram/firstProgram.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
\floatRowSep%
6060
%
6161
\subfloat[][%
62-
We enter a name for the new \python\ file (here:~\directory{very\_first\_program}) and hit \keys{\enter}.
62+
We enter a name for the new \python\ file (here:~\directory{very\_first\_program}) and hit \keys{\return}.
6363
\label{fig:firstProgram06createPythonFileNameEntered}%
6464
]{\tightbox{\includegraphics[width=0.775\linewidth]{\currentDir/firstProgram06createPythonFileNameEntered}}}%
6565
%

text/main/basics/gettingStarted/installingPyCharm/installingPyCharmUbuntu/installingPyCharmUbuntu.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
\floatRowSep%
1212
%
1313
\subfloat[][%
14-
This command requires the super user password, which we type in and then press~\keys{\enter}.%
14+
This command requires the super user password, which we type in and then press~\keys{\return}.%
1515
\label{fig:installingPyCharmUbuntu02sudo}%
1616
]{\includegraphics[width=0.7\linewidth]{\currentDir/installingPyCharmUbuntu02sudo}}%
1717
%
@@ -65,7 +65,7 @@
6565
\pycharm\ is available as Snap package under \ubuntu\ \linux~\cite{C2025SD,J2024PCPCE}.
6666
The installation process is very easy and follows the steps illustrated in \cref{fig:installingPyCharmUbuntu}.
6767
First, you open a \pgls{terminal} by pressing \ubuntuTerminal.
68-
Then, enter the command \bashil{sudo snap install pycharm-community --classic} and hit~\keys{\enter}~(\cref{fig:installingPyCharmUbuntu01snapInstall}).
68+
Then, enter the command \bashil{sudo snap install pycharm-community --classic} and hit~\keys{\return}~(\cref{fig:installingPyCharmUbuntu01snapInstall}).
6969
This installs the \pycharm\ software package and the necessary super user privileges are obtained via the pre-pended \pgls{sudo}, which will ask us to enter the root password, as sketched in \cref{fig:installingPyCharmUbuntu02sudo}.
7070
Then, the installation process basically runs automatically.
7171
Once it has completed (see \cref{fig:installingPyCharmUbuntu05snapInstallFinished}), you can press the \keys{\OSwin} key and type \bashil{pycharm} in the launcher window to find \pycharm~(\cref{fig:installingPyCharmUbuntu06launcher}).

text/main/basics/gettingStarted/installingPython/installingPythonWindows/installingPythonWindows.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
%
5454
Example installation steps for \python\ on \microsoftWindows\ (version~10) are sketched in \cref{fig:installPythonWindows}.
5555
First, you would open a \pgls{terminal} using and \windowsTerminal, as shown in \cref{fig:installingPythonWindows01openTerminal}.
56-
If \python\ is installed, then typing \bashil{python3 --version} in the terminal and hitting~\keys{\enter} would print the version of the \python\ installation.
57-
If it is not installed, however, then \microsoftWindows\ will print a message informing you that \python\ is not yet installed and that you can reach the web installer by just typing \bashil{python3} (and hitting~\keys{\enter}, of course).
56+
If \python\ is installed, then typing \bashil{python3 --version} in the terminal and hitting~\keys{\return} would print the version of the \python\ installation.
57+
If it is not installed, however, then \microsoftWindows\ will print a message informing you that \python\ is not yet installed and that you can reach the web installer by just typing \bashil{python3} (and hitting~\keys{\return}, of course).
5858
We do this in \cref{fig:installingPythonWindows03python}, which leads us to the installation screen (\cref{fig:installingPythonWindows04installGet}), where we need to press the \keys{Get} button.
5959
This will then download (\cref{fig:installingPythonWindows05downloading}) and install \python.
6060
When this process is completed, the screen just shows nothing (\cref{fig:installingPythonWindows06finished}).

text/main/basics/gettingStarted/installingPython/pythonUnderUbuntu/pythonUnderUbuntu.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
%
1010
\begin{sloppypar}%
1111
Under \ubuntu\ \linux, \python~\softwareStyle{3} is already pre-installed.
12-
You can open a \pgls{terminal}~\cite{B2022ELATCL} by pressing~\ubuntuTerminal, then type in \bashil{python3 --version}, hit \keys{\enter}, and get the result illustrated in \cref{fig:ubuntuTerminalPythonVersion}:
12+
You can open a \pgls{terminal}~\cite{B2022ELATCL} by pressing~\ubuntuTerminal, then type in \bashil{python3 --version}, hit \keys{\return}, and get the result illustrated in \cref{fig:ubuntuTerminalPythonVersion}:
1313
\end{sloppypar}%
1414
%
1515
\FloatBarrier%

text/main/basics/gettingStarted/pythonInTheTerminal/pythonInTheTerminal.tex

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
%
88
\subfloat[][%
99
Open a \pgls{terminal} (by pressing \ubuntuTerminal\ under \ubuntu\ \linux; under \microsoftWindows\ \windowsTerminal). %
10-
Change into the directory \inQuotes{directory} where your \python\ file is located, by typing \bashil{cd directory} and hit \keys{\enter}. %
10+
Change into the directory \inQuotes{directory} where your \python\ file is located, by typing \bashil{cd directory} and hit \keys{\return}. %
1111
(I here had it in the temporary directory \bashil{/tmp}, you will have it elsewhere\dots)%
1212
\label{fig:terminalPython1cd}%
1313
]{\includegraphics[width=0.9\linewidth]{\currentDir/terminalPython1cd}}%
@@ -22,7 +22,7 @@
2222
\floatRowSep%
2323
%
2424
\subfloat[][%
25-
Execute a \python\ program \inQuotes{program.py} by typing \bashil{python3 program.py} and hit \keys{\enter}. %
25+
Execute a \python\ program \inQuotes{program.py} by typing \bashil{python3 program.py} and hit \keys{\return}. %
2626
In our case, the program is \inQuotes{very\_first\_program.py}.%
2727
\label{fig:terminalPython3python}%
2828
]{\includegraphics[width=0.9\linewidth]{\currentDir/terminalPython3python}}%
@@ -61,7 +61,7 @@
6161
\centering%
6262
%
6363
\subfloat[][%
64-
We enter the \inQuotes{Hello World!} program from \cref{lst:very_first_program} and press \keys{\enter}.%
64+
We enter the \inQuotes{Hello World!} program from \cref{lst:very_first_program} and press \keys{\return}.%
6565
\label{fig:pycharmConsole3writingCode}%
6666
]{\tightbox{\includegraphics[width=0.76\linewidth]{\currentDir/pycharmConsole3writingCode}}}%
6767
%
@@ -80,7 +80,7 @@
8080
\centering%
8181
%
8282
\subfloat[][%
83-
Open a \pgls{terminal} (by pressing \ubuntuTerminal\ under \ubuntu\ \linux; under \microsoftWindows\ \windowsTerminal), enter \bashil{python3}, then hit \keys{\enter}.%
83+
Open a \pgls{terminal} (by pressing \ubuntuTerminal\ under \ubuntu\ \linux; under \microsoftWindows\ \windowsTerminal), enter \bashil{python3}, then hit \keys{\return}.%
8484
\label{fig:terminalConsole1python}%
8585
]{\includegraphics[width=0.852\linewidth]{\currentDir/terminalConsole1python}}%
8686
%
@@ -94,7 +94,7 @@
9494
\floatRowSep%
9595
%
9696
\subfloat[][%
97-
We enter the \inQuotes{Hello World!} program from \cref{lst:very_first_program} and press \keys{\enter}.%
97+
We enter the \inQuotes{Hello World!} program from \cref{lst:very_first_program} and press \keys{\return}.%
9898
\label{fig:terminalConsole3writingCode}%
9999
]{\includegraphics[width=0.852\linewidth]{\currentDir/terminalConsole3writingCode}}%
100100
%
@@ -113,7 +113,7 @@
113113
\centering%
114114
%
115115
\subfloat[][%
116-
We exit the console by typing \pythonil{exit()}\pythonIdx{exit} and pressing \keys{\enter}.%
116+
We exit the console by typing \pythonil{exit()}\pythonIdx{exit} and pressing \keys{\return}.%
117117
\label{fig:terminalConsole5exit}%
118118
]{\includegraphics[width=0.852\linewidth]{\currentDir/terminalConsole5exit}}%
119119
%
@@ -137,7 +137,7 @@
137137
%
138138
\item Actually, we can also write a \python\ program with a normal text editor. %
139139
A \python\ program is just a normal text file, after all. %
140-
We can execute such a text file by entering its directory and typing \bashil{python3 programName} (where \bashil{programName} is \bashil{very_first_program.py}, in our case) and hitting \keys{\enter}. %
140+
We can execute such a text file by entering its directory and typing \bashil{python3 programName} (where \bashil{programName} is \bashil{very_first_program.py}, in our case) and hitting \keys{\return}. %
141141
Then the program is executed directly in the \pgls{terminal}. %
142142
This process is shown in \cref{sec:terminalPython,fig:terminalPython}.%
143143
%
@@ -156,11 +156,11 @@
156156
Under \ubuntu\ \linux, we simply press \ubuntuTerminal.
157157
Under \microsoftWindows, we have to \windowsTerminal.
158158
Once the terminal is open, we need to change into the directory where the program is located.
159-
Under both \linux\ and \microsoftWindows, this can be done by typing the command \bashil{cd}, followed by the path to the directory, and hitting \keys{\enter}.\footnote{%
159+
Under both \linux\ and \microsoftWindows, this can be done by typing the command \bashil{cd}, followed by the path to the directory, and hitting \keys{\return}.\footnote{%
160160
Under \microsoftWindows, you may also need to change into the correct drive first.}
161161
We provide a screenshot for that, taken under \ubuntu\ \linux, in \cref{fig:terminalPython1cd}.
162162
Now we simply call the \python\ interpreter by writing \bashil{python3} followed by the file name of our program, which is \bashil{very_first_program.py} in our case.
163-
In \cref{fig:terminalPython3python} we do this and hit \keys{\enter}, which causes the \python\ interpreter to execute our program.
163+
In \cref{fig:terminalPython3python} we do this and hit \keys{\return}, which causes the \python\ interpreter to execute our program.
164164
The output \inQuotes{Hello World!} is then printed into the \pgls{terminal} in \cref{fig:terminalPython4result}.%
165165
\endhsection%
166166
%
@@ -176,7 +176,7 @@
176176
This directly brings us to the \python\ console~(\cref{fig:pycharmConsole2consoleOpen}).
177177
We can enter the one-line-program from \cref{lst:very_first_program}, as illustrated in \cref{fig:pycharmConsole3writingCode}.
178178
Notice that the input prompt of the console is marked by the three greater characters \bashil{>>>} after which we enter our text.
179-
Pressing \keys{\enter} after writing the code leads to the expected output shown in \cref{fig:pycharmConsole4codeOutput}.
179+
Pressing \keys{\return} after writing the code leads to the expected output shown in \cref{fig:pycharmConsole4codeOutput}.
180180
This output directly appears in the console and is not preceded by any other text, in particular not by \bashil{>>>}, which makes it easy to visually distinguish what the input and output in a \python\ console are.%
181181
\endhsection%
182182
%
@@ -186,14 +186,14 @@
186186
We therefore first need to open a normal terminal.
187187
Under \ubuntu\ \linux, we simply press \ubuntuTerminal.
188188
Under \microsoftWindows, we have to \windowsTerminal.
189-
Either way, the terminal opens and we can enter \bashil{python3} and press \keys{\enter}, as shown in \cref{fig:terminalConsole1python}.
189+
Either way, the terminal opens and we can enter \bashil{python3} and press \keys{\return}, as shown in \cref{fig:terminalConsole1python}.
190190
Now the \python\ interpreter starts right inside the \pgls{terminal}~(\cref{fig:terminalConsole2pythonRunning}).
191191
The prompt, i.e., the place where we can write our code, again is preceded by the \bashil{>>>} characters.
192-
As illustrated in \cref{fig:terminalConsole3writingCode}, we copy the single line of code, \pythonil{print("Hello World!")}\pythonIdx{print} from \cref{lst:very_first_program} and press \keys{\enter}.
192+
As illustrated in \cref{fig:terminalConsole3writingCode}, we copy the single line of code, \pythonil{print("Hello World!")}\pythonIdx{print} from \cref{lst:very_first_program} and press \keys{\return}.
193193
The output \inQuotes{Hello World!} is printed as expected in \cref{fig:terminalConsole4codeOutput}.
194194
However, we now are still in the \python\ interpreter.
195195
In order to leave it and to, maybe, enter other commands in the \pgls{terminal}, we have to use another new \python\ instruction:
196-
We type in \pythonil{exit()} and press \keys{\enter}, as shown in \cref{fig:terminalConsole5exit}, which causes the \python\ interpreter to exit.
196+
We type in \pythonil{exit()} and press \keys{\return}, as shown in \cref{fig:terminalConsole5exit}, which causes the \python\ interpreter to exit.
197197
We are now back in the basic terminal, as shown in \cref{fig:terminalConsole6left}.
198198
In these figures, I was using \ubuntu\ \linux.
199199
On \microsoftWindows\ or other \linux\ variants, the process would have looked quite similar.%

text/main/basics/simpleDataTypesAndOperations/documentation/documentation.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@
275275
\floatRowSep%
276276
%
277277
\subfloat[][%
278-
We enter our query \emph{\inQuotes{python rounding towards infinity}} and press~\keys{\enter}.%
278+
We enter our query \emph{\inQuotes{python rounding towards infinity}} and press~\keys{\return}.%
279279
\label{fig:stackOverflow03queryEntered}%
280280
]{\tightbox{\includegraphics[width=0.47\linewidth]{\currentDir/stackOverflow01websiteLoading}}}%
281281
%

text/main/basics/simpleDataTypesAndOperations/int/int.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
(The same example is given in \cref{exec:int_arithmetics}, just as listing instead of screenshot.
3636
We will use such listings from now on, as they convey the exactly same information, but are easier to read and I can more conveniently include comments.)
3737
Like back in \cref{sec:terminalConsolem}, press \ubuntuTerminal\ under \ubuntu\ \linux\ or \windowsTerminal\ under \microsoftWindows\ to open a \pgls{terminal}.
38-
After entering \bashil{python3} and hitting \keys{\enter}, we can begin experimenting with integer maths.
38+
After entering \bashil{python3} and hitting \keys{\return}, we can begin experimenting with integer maths.
3939
The lines with \python\ commands in the console begin with \pythonil{>>>}, whereas the result is directly output below them without prefix string.
4040

41-
In the very first line of \cref{fig:pythonIntMathInConsoleArith,exec:int_arithmetics}, we enter \pythonil{4 + 3}\pythonIdx{+} and hit \keys{\enter}.
41+
In the very first line of \cref{fig:pythonIntMathInConsoleArith,exec:int_arithmetics}, we enter \pythonil{4 + 3}\pythonIdx{+} and hit \keys{\return}.
4242
The result is displayed on the next line and, as expected, is \pythonil{7}.
43-
We then attempt to multiply the two integers \pythonil{7} and \pythonil{5} by typing \pythonil{7 * 5}\pythonIdx{*!multiplication} and hitting \keys{\enter}.
43+
We then attempt to multiply the two integers \pythonil{7} and \pythonil{5} by typing \pythonil{7 * 5}\pythonIdx{*!multiplication} and hitting \keys{\return}.
4444
The result is \pythonil{35}.
4545

4646
\python\ does not just support normal arithmetics as you have learned it in school, it also follows the operator precedence rules.

text/main/basics/simpleDataTypesAndOperations/none/none.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
\Cref{exec:none} illustrates some of the things we can do with \pythonilIdx{None}.
1818
If we write \pythonilIdx{None} into the \python\ console, then nothing happens.
19-
In the past, we just wrote values, such as \pythonil{34} and, after we hit~\keys{\enter}, they would be printed again.
19+
In the past, we just wrote values, such as \pythonil{34} and, after we hit~\keys{\return}, they would be printed again.
2020
Not so~\pythonilIdx{None}.
2121
If we want to print~\pythonilIdx{None}, we have to force it by using the function~\pythonilIdx{print}.
2222
\pythonil{print(None)} then indeed prints~\pythonilIdx{None}.

text/main/basics/simpleDataTypesAndOperations/str/str.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,9 +383,9 @@
383383
\pythonil{print("The horizontal tab is like a bigger space: '\\t'.")} yields \inlinelistingbox{\texttt{The~horizontal~tab~is~like~a~bigger~space:~'~~~~'.}}.
384384

385385
Finally, a backslash can also escape an actual newline in your string\pythonIdx{str!escaping}\pythonIdx{escaping}.
386-
If you have a string that is too long to write on a single line but you do not want to have a linebreak inside the actual string, you can simply put a backslash, hit \keys{\enter}, and continue the typing the string.
386+
If you have a string that is too long to write on a single line but you do not want to have a linebreak inside the actual string, you can simply put a backslash, hit \keys{\return}, and continue the typing the string.
387387
The linebreak will then be ignored entirely.
388-
Therefore, if you print~\pythonil{print("Hello\\}, hit \keys{\enter}, and then continue to write \pythonil{World!")}, this produces the output~\textil{HelloWorld!}.
388+
Therefore, if you print~\pythonil{print("Hello\\}, hit \keys{\return}, and then continue to write \pythonil{World!")}, this produces the output~\textil{HelloWorld!}.
389389

390390
\Pglspl{escapeSequence} allow us to write arbitrary text in strings.
391391
We already learned the sequences \inQuotes{\textbraceleft\textbraceleft}\pythonIdx{\textbraceleft\textbraceleft} and \inQuotes{\textbraceright\textbraceright}\pythonIdx{\textbraceright\textbraceright} that were designed for \pglspl{fstring} only.
@@ -403,7 +403,7 @@
403403
Before we discussed that strings in \python\ are delimited either by \pythonil{"}\pythonIdx{\textquotedbl\idxdots\textquotedbl} or \pythonil{'}\pythonIdx{\textquotesingle\idxdots\textquotesingle} on each side.
404404
However, we can actually delimit them also delimit them with \emph{three quotation marks} on each side, i.e., with either \pythonil{"""}\pythonIdx{\textquotedbl\textquotedbl\textquotedbl\idxdots\textquotedbl\textquotedbl\textquotedbl} or \pythonil{'''}\pythonIdx{\textquotesingle\textquotesingle\textquotesingle\idxdots\textquotesingle\textquotesingle\textquotesingle}.
405405
Such string delimiters are used for multi-line strings.
406-
In such strings, you can insert linebreaks by hitting \keys{\enter} completely normally.
406+
In such strings, you can insert linebreaks by hitting \keys{\return} completely normally.
407407
You can use the \pglspl{escapeSequence} from the previous section as well.
408408
The main use case are \pglspl{docstring}, which we will discuss later, see, e.g., \cref{bp:module:docstrings}.%
409409
%

text/main/basics/variables/assignment/assignment.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@
378378
For your convenience, we also showed the results when executing the program in \pycharm\ or the \ubuntu\ \pgls{terminal} in \cref{fig:variables:liuHuiPi}.
379379
To open a \pgls{terminal} under \ubuntu\ \linux, you would press~\ubuntuTerminal, whereas under \microsoftWindows, you~\windowsTerminal.
380380
With the command \bashil{cd}, you would enter the directory where our program \programUrl{variables:pi_liu_hui} is located.
381-
You would then type in \bashil{python3 pi_liu_hui.py} and hit~\keys{\enter}.
381+
You would then type in \bashil{python3 pi_liu_hui.py} and hit~\keys{\return}.
382382
As you can see in \cref{fig:liuHuiPiTerminal}, you will get the same output as given in \cref{exec:variables:pi_liu_hui}.
383383

384384
Alternatively, if you are using \pycharm, you can open the program file \programUrl{variables:pi_liu_hui} as shown in \cref{fig:liuHuiPiPyCharm1}.

0 commit comments

Comments
 (0)