diff options
author | Puneeth Chaganti | 2009-10-08 19:06:57 +0530 |
---|---|---|
committer | Puneeth Chaganti | 2009-10-08 19:06:57 +0530 |
commit | 21a1eddc98654bd18e6a9d7753a45e83918f7b1a (patch) | |
tree | 2a86b486e677819b4582d64ba30babb0955bea75 /day1/Session-4.tex | |
parent | 3f0f51a15935e93c6c251e8439ee268b2778de5c (diff) | |
parent | adb321ed1261252ebdf52c4dd3b5699365f7daea (diff) | |
download | workshops-21a1eddc98654bd18e6a9d7753a45e83918f7b1a.tar.gz workshops-21a1eddc98654bd18e6a9d7753a45e83918f7b1a.tar.bz2 workshops-21a1eddc98654bd18e6a9d7753a45e83918f7b1a.zip |
Merged Mainline and my branch.
Diffstat (limited to 'day1/Session-4.tex')
-rwxr-xr-x | day1/Session-4.tex | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/day1/Session-4.tex b/day1/Session-4.tex index e9adbf3..4dc586b 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} @@ -191,8 +193,8 @@ False \begin{frame} \frametitle{Problem set 6.2} \begin{description} - \item[2.2.1] Given a dictionary of the names of students and their marks, identify how many duplicate marks are there? and what are these? - \item[2.2.2] Given a string of the form ``4-7, 9, 12, 15'' find the numbers missing in this list for a given range. + \item[6.2.1] Given a dictionary of the names of students and their marks, identify how many duplicate marks are there? and what are these? + \item[6.2.2] Given a string of the form ``4-7, 9, 12, 15'' find the numbers missing in this list for a given range. \end{description} \inctime{10} \end{frame} @@ -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} |