Skip to content

Commit a21d4ed

Browse files
committed
added text describing how the examples can be downloaded
1 parent 7673013 commit a21d4ed

File tree

11 files changed

+88
-2
lines changed

11 files changed

+88
-2
lines changed

notation/sources.sty

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
\xdef\programmingWithPythonRepo{https://github.com/thomasWeise/programmingWithPython}%
66
\xdef\programmingWithPythonUrl{https://thomasweise.github.io/programmingWithPython}%
77
%
8-
\xdef\programmingWithPythonCodeRepo{https://github.com/thomasWeise/programmingWithPythonCode}%
8+
\xdef\programmingWithPythonCodeRepoName{programmingWithPythonCode}%
9+
\xdef\programmingWithPythonCodeRepo{https://github.com/thomasWeise/\programmingWithPythonCodeRepoName}%
910
%
7.66 KB
Loading
7.92 KB
Loading
6.98 KB
Loading
6.17 KB
Loading
25.8 KB
Loading
145 KB
Binary file not shown.

text/main/basics/gettingStarted/examples/downloadExamples.svg

Lines changed: 2 additions & 0 deletions
Loading
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
\hsection{Getting the Examples from this Book}%
2+
%
3+
\begin{figure}%
4+
\centering%
5+
\includegraphics[width=0.8\linewidth,trim={0pt 1cm 0pt 0pt},clip]{\currentDir/downloadExamples}%
6+
\caption{%
7+
Downloading all the example source codes as a single \texttt{zip}~archive from \expandafter\url{\programmingWithPythonCodeRepo}.}%
8+
\label{fig:downloadExamples}%
9+
\end{figure}%
10+
%
11+
\begin{figure}%
12+
\centering%
13+
%
14+
\subfloat[][%
15+
Click \menu{Clone Repository} in the \pycharm\ welcome screen.%
16+
\label{fig:clone01welcomeToPycharm}%
17+
]{\tightbox{\includegraphics[width=0.45\linewidth]{\currentDir/clone01welcomeToPycharm}}}%
18+
%
19+
\strut\hfill\strut%
20+
%
21+
\subfloat[][%
22+
Selecting \menu{URL:} \expandafter\url{\programmingWithPythonCodeRepo} and a reasonable destination \menu{Directory:} in the next dialog, then click \menu{Clone}.%
23+
\label{fig:clone02selectRepoAndDestination}%
24+
]{\tightbox{\includegraphics[width=0.45\linewidth]{\currentDir/clone02selectRepoAndDestination}}}%
25+
%
26+
\\[10pt]%
27+
%
28+
\subfloat[][%
29+
Wait while \pycharm\ is cloning (downloading) the repository.%
30+
\label{fig:clone03cloning}%
31+
]{\tightbox{\includegraphics[width=0.45\linewidth]{\currentDir/clone03cloning}}}%
32+
%
33+
\strut\hfill\strut%
34+
%
35+
\subfloat[][%
36+
If asked, click \menu{Trust Project} after confirming that you indeed downloaded the right code and if you trust our code.%
37+
\label{fig:clone04trustProject}%
38+
]{\tightbox{\includegraphics[width=0.45\linewidth]{\currentDir/clone04trustProject}}}%
39+
%
40+
\\[10pt]%
41+
%
42+
\subfloat[][%
43+
The project with all the examples from this book is now downloaded and can be accessed in \pycharm.%
44+
\label{fig:clone05finished}%
45+
]{\tightbox{\includegraphics[width=0.6\linewidth]{\currentDir/clone05finished}}}%
46+
%
47+
\caption{Using \pycharm\ to clone (download) and import all the examples from this book.}%
48+
\label{fig:cloningExamples}%
49+
\end{figure}%
50+
%
51+
This book comes with a lot of examples programs written in \python.
52+
While our first explorations of the simple data types will mainly use the \python\ console, we will later almost exclusively write programs in \python\ files.
53+
Every single one of them is available in the \pgls{git} repository \texttt{\programmingWithPythonCodeRepoName}.
54+
You can directly access this repository at \pgls{github} under \expandafter\url{\programmingWithPythonCodeRepo}.%
55+
%
56+
\begin{sloppypar}%
57+
On the website, you can directly download all the examples as illustrated in \cref{fig:downloadExamples}.
58+
First, you would click on the little downward facing triangle in the button \menu{Code}.
59+
This will open a small dialog \menu{Clone} in which you can click on the \menu{Download ZIP} button.
60+
This, in turn, enters the URL~\expandafter\url{\programmingWithPythonCodeRepo/archive/refs/heads/main.zip} into your browser's download queue.
61+
A \texttt{zip}~archive is a single file that can contain other files and folders and can be opened by the standard file managers both on \ubuntu\ and \windows.
62+
Once downloaded, the archive contains all the examples that we use in our book.%
63+
\end{sloppypar}%
64+
%
65+
\begin{sloppypar}%
66+
Alternatively to downloading a \texttt{zip} archive with the examples from this book, you can also directly create a new project in \pycharm\ by cloning (basically, downloading) the repository as illustrated in \cref{fig:cloningExamples}.
67+
In the \pycharm\ welcome screen, you click \menu{Clone Repository} as shown in \cref{fig:clone01welcomeToPycharm}.
68+
In the next dialog, you have to select a source \menu{URL:}, which will be \programmingWithPythonCodeRepo.
69+
You also need to choose a \menu{Directory:} where the new project should be located.
70+
All the contents of the examples repository will be downloaded into this directory as well.
71+
In \cref{fig:clone02selectRepoAndDestination}, I selected \textil{/tmp/programmingWithPythonCode}, i.e., a directory on my partition for temporary files.
72+
This directory will be cleared at every system boot, so you would certainly choose a more reasonable destination.
73+
After clicking \menu{Clone}, the downloading will begin, as sketched in \cref{fig:clone03cloning}.%
74+
\end{sloppypar}%
75+
%
76+
Once the repository has been downloaded, \pycharm\ may ask you whether you trust this project.
77+
After making sure that you indeed downloaded the examples for this book (and if you deem this code trustworthy), you can click \menu{Trust Project}, as \cref{fig:clone04trustProject}.
78+
Finally, as \cref{fig:clone05finished} shows, you can now see and play with and run all the examples in \pycharm.%
79+
%
80+
\FloatBarrier%
81+
\endhsection%
82+
%

text/main/basics/gettingStarted/gettingStarted.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
\hinput{installingPyCharm}{installingPyCharm}%
3333
\hinput{firstProgram}{firstProgram}%
3434
\hinput{pythonInTheTerminal}{pythonInTheTerminal}%
35+
\hinput{examples}{examples}%
3536
\hinput{summary}{summary}%
3637
%
3738
\endhsection%

0 commit comments

Comments
 (0)