Commit 64977f7d authored by Mihai's avatar Mihai

Finished introduction

parent 519ebb17
......@@ -31,8 +31,23 @@
left=0.1cm,
arc=0mm,
colframe=black]}
{\end{tcolorbox}
}
{\end{tcolorbox}}
\newenvironment{terminal}
{\begin{tcolorbox}[title=terminal,
title filled=false,
fonttitle=\scriptsize,
fontupper=\footnotesize,
enhanced,
colback=monokaibg,
drop small lifted shadow,
boxrule=0.1mm,
left=0.1cm,
arc=0mm,
colframe=black]}
{\end{tcolorbox}}
\newcommand{\hrefcc}[2]{\textcolor{#1}{\href{#2}{#2}}}
\newcommand{\hrefc}[3]{\textcolor{#1}{\href{#2}{#3}}}
......@@ -287,15 +302,73 @@
We'll use Python 3.7 for this course.
\end{pframe}
% \subsection{}
% \begin{pframe}
% \begin{itemize}
% \item
% \end{itemize}
% \end{pframe}
\section{Python as a calculator}
\section{Running Python code}
\begin{pframe}
Two main ways of writing and executing Python code:
\begin{itemize}
\item Interactively:
\begin{itemize}
\item Statement by statement, directly in the interpreter.
\end{itemize}
\item Non-interactively:
\begin{itemize}
\item By editing in a file and running the code afterwards.
\end{itemize}
\end{itemize}
\end{pframe}
\subsection{The standard Python interpreter}
\begin{pframe}
Start it by typing \textbf{python} on the command line:
\begin{terminal}
\color{white}{
\begin{lstlisting}[frame=,style=,numbers=none]
$ python
Python 3.7 (default, Nov 12 2018, 13:43:14)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
\end{lstlisting}}
\end{terminal}
\begin{itemize}
\item It shows an interpreter prompt.
\item You can give it Python code to interpret.
\end{itemize}
\end{pframe}
\subsection{The IPython interpreter}
\begin{pframe}
Similar to the standard Python interpreter, but with:
\begin{itemize}
\item syntax highlighting;
\item tab completion;
\item cross-session history,
\item etc.
\end{itemize}
Start it by typing \textbf{ipython} on the command line:
\begin{terminal}
\color{white}{
\begin{lstlisting}[frame=,style=,numbers=none]
$ ipython
Python 3.7 (default, Nov 12 2018, 13:43:14)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1.0 -- An enhanced Interactive Python. Type '?' for help.
\end{lstlisting}}
\begin{pythonin}{python}
\end{pythonin}
\addtocounter{cntr}{-1}
\end{terminal}
\begin{itemize}
\item It shows an interpreter prompt.
\item You can give it Python code to interpret.
\end{itemize}
\end{pframe}
\section{Python as a calculator}
\subsection{Integers}
\begin{pframe}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment