|
| 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 | +% |
0 commit comments