diff options
-rw-r--r-- | day1/DebugginDiagram.png | bin | 0 -> 9416 bytes | |||
-rw-r--r-- | day1/Session-1.snm | 0 | ||||
-rw-r--r-- | day1/Session-1.vrb | 14 | ||||
-rw-r--r-- | day1/Session-2.snm | 0 | ||||
-rw-r--r-- | day1/Session-2.vrb | 12 | ||||
-rw-r--r-- | day1/Session-3.snm | 0 | ||||
-rw-r--r-- | day1/Session-4.snm | 0 | ||||
-rwxr-xr-x | day1/Session-4.tex | 32 | ||||
-rw-r--r-- | day1/Session-4.vrb | 2 |
9 files changed, 27 insertions, 33 deletions
diff --git a/day1/DebugginDiagram.png b/day1/DebugginDiagram.png Binary files differnew file mode 100644 index 0000000..530d1a0 --- /dev/null +++ b/day1/DebugginDiagram.png diff --git a/day1/Session-1.snm b/day1/Session-1.snm deleted file mode 100644 index e69de29..0000000 --- a/day1/Session-1.snm +++ /dev/null diff --git a/day1/Session-1.vrb b/day1/Session-1.vrb deleted file mode 100644 index 2fb75f0..0000000 --- a/day1/Session-1.vrb +++ /dev/null @@ -1,14 +0,0 @@ -\frametitle {Basic looping} - \begin{lstlisting} -# Fibonacci series: -# the sum of two elements -# defines the next -a, b = 0, 1 -while b < 10: - print b, - a, b = b, a + b - -\end{lstlisting} -\typ{1 1 2 3 5 8}\\ -\alert{Recall it is easy to write infinite loops with \kwrd{while}} - \inctime{20} diff --git a/day1/Session-2.snm b/day1/Session-2.snm deleted file mode 100644 index e69de29..0000000 --- a/day1/Session-2.snm +++ /dev/null diff --git a/day1/Session-2.vrb b/day1/Session-2.vrb deleted file mode 100644 index 0b55248..0000000 --- a/day1/Session-2.vrb +++ /dev/null @@ -1,12 +0,0 @@ -\frametitle {\typ{for}: the list companion} - \begin{lstlisting} -In [89]: for p, ch in enumerate( a ): - ....: print p, ch - ....: - ....: -0 a -1 b -2 c - \end{lstlisting} -Try: \typ{print enumerate(a)} -\inctime{10} diff --git a/day1/Session-3.snm b/day1/Session-3.snm deleted file mode 100644 index e69de29..0000000 --- a/day1/Session-3.snm +++ /dev/null diff --git a/day1/Session-4.snm b/day1/Session-4.snm deleted file mode 100644 index e69de29..0000000 --- a/day1/Session-4.snm +++ /dev/null diff --git a/day1/Session-4.tex b/day1/Session-4.tex index e9adbf3..652c9af 100755 --- a/day1/Session-4.tex +++ b/day1/Session-4.tex @@ -39,6 +39,8 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries} +\usepackage{pgf} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Macros \setbeamercolor{emphbar}{bg=blue!20, fg=black} @@ -339,10 +341,10 @@ or modulo by zero \begin{frame}[fragile] \frametitle{Debugging effectively} \begin{itemize} - \item \kwrd{print} based strategy - \item Process: Hypothesis, test, refine, rinse-repeat + \item \kwrd{print} based strategy + \item Process: \end{itemize} -\inctime{15} +\pgfimage[interpolate=true,width=5cm,height=5cm]{DebugginDiagram.png} \end{frame} \begin{frame}[fragile] @@ -350,7 +352,27 @@ or modulo by zero \begin{itemize} \item Using \typ{\%debug} and \typ{\%pdb} in IPython \end{itemize} -\inctime{15} +\end{frame} + +\begin{frame}[fragile] +\frametitle{Debugging in IPython} +\small +\begin{lstlisting} +In [1]: import mymodule +In [2]: mymodule.test() +--------------------------------------------- +NameError Traceback (most recent call last) +/media/python/iitb/workshops/day1/<ipython console> in <module>() +/media/python/iitb/workshops/day1/mymodule.py in test() + 1 def test(): +----> 2 print spam +NameError: global name 'spam' is not defined +In [3]: %debug +> /media/python/iitb/workshops/day1/mymodule.py(2)test() + 0 print spam +ipdb> +\end{lstlisting} +\inctime{15} \end{frame} \begin{frame}[fragile] @@ -366,7 +388,7 @@ or modulo by zero \item Advances Functions: default arguments, keyword arguments \item Functional Programming, list comprehensions \item Errors and Exceptions in Python - \item Debugging: How to use pdb, \%pdb and \%debug in IPython + \item Debugging: \%pdb and \%debug in IPython \end{itemize} \end{frame} \end{document} diff --git a/day1/Session-4.vrb b/day1/Session-4.vrb deleted file mode 100644 index 5edf650..0000000 --- a/day1/Session-4.vrb +++ /dev/null @@ -1,2 +0,0 @@ -\frametitle {Debugging: Exercise} -\inctime{10} |