day2/session3.tex
author Madhusudan.C.S <madhusudancs@gmail.com>
Fri, 06 Nov 2009 18:33:08 +0530
changeset 288 c4e25269a86c
parent 263 8a4a1e5aec85
child 294 f05b1c457120
child 297 a835affb1447
permissions -rw-r--r--
Reorganized slides.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
     2
%Tutorial slides on Python.
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     3
%
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
     4
% Author: FOSSEE 
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
     5
% Copyright (c) 2009, FOSSEE, IIT Bombay
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     6
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
     7
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
     8
\documentclass[14pt,compress]{beamer}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
     9
%\documentclass[draft]{beamer}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    10
%\documentclass[compress,handout]{beamer}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    11
%\usepackage{pgfpages} 
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    12
%\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm]
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    13
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    14
% Modified from: generic-ornate-15min-45min.de.tex
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    15
\mode<presentation>
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    16
{
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    17
  \usetheme{Warsaw}
239
8953675dc056 Added slide numbers.
Puneeth Chaganti <punchagan@fossee.in>
parents: 220
diff changeset
    18
  \useoutertheme{infolines}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    19
  \setbeamercovered{transparent}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    20
}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    21
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    22
\usepackage[english]{babel}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    23
\usepackage[latin1]{inputenc}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    24
%\usepackage{times}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    25
\usepackage[T1]{fontenc}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    26
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    27
% Taken from Fernando's slides.
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    28
\usepackage{ae,aecompl}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    29
\usepackage{mathpazo,courier,euler}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    30
\usepackage[scaled=.95]{helvet}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    31
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    32
\definecolor{darkgreen}{rgb}{0,0.5,0}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    33
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    34
\usepackage{listings}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    35
\lstset{language=Python,
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    36
    basicstyle=\ttfamily\bfseries,
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    37
    commentstyle=\color{red}\itshape,
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    38
  stringstyle=\color{darkgreen},
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    39
  showstringspaces=false,
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    40
  keywordstyle=\color{blue}\bfseries}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    41
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    42
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    43
% Macros
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    44
\setbeamercolor{emphbar}{bg=blue!20, fg=black}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    45
\newcommand{\emphbar}[1]
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    46
{\begin{beamercolorbox}[rounded=true]{emphbar} 
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    47
      {#1}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    48
 \end{beamercolorbox}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    49
}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    50
\newcounter{time}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    51
\setcounter{time}{0}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    52
\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    53
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    54
\newcommand{\typ}[1]{\texttt{#1}}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    55
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    56
\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}}  }
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    57
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    58
%%% This is from Fernando's setup.
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    59
% \usepackage{color}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    60
% \definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    61
% % Use and configure listings package for nicely formatted code
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    62
% \usepackage{listings}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    63
% \lstset{
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    64
%    language=Python,
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    65
%    basicstyle=\small\ttfamily,
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    66
%    commentstyle=\ttfamily\color{blue},
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    67
%    stringstyle=\ttfamily\color{orange},
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    68
%    showstringspaces=false,
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    69
%    breaklines=true,
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    70
%    postbreak = \space\dots
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    71
% }
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    72
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    73
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    74
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    75
% Title page
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    76
\title[Basic Python]{Python language: Data structures and functions}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    77
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    78
\author[FOSSEE Team] {The FOSSEE Group}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    79
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    80
\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    81
\date[] {8 November, 2009\\Day 2, Session 3}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    82
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    83
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    84
%\pgfdeclareimage[height=0.75cm]{iitmlogo}{iitmlogo}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
    85
%\logo{\pgfuseimage{iitmlogo}}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    86
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    87
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    88
%% Delete this, if you do not want the table of contents to pop up at
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    89
%% the beginning of each subsection:
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    90
\AtBeginSubsection[]
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    91
{
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    92
  \begin{frame}<beamer>
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    93
    \frametitle{Outline}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    94
    \tableofcontents[currentsection,currentsubsection]
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    95
  \end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    96
}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    97
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    98
\AtBeginSection[]
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
    99
{
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   100
  \begin{frame}<beamer>
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   101
    \frametitle{Outline}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   102
    \tableofcontents[currentsection,currentsubsection]
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   103
  \end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   104
}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   105
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   106
% If you wish to uncover everything in a step-wise fashion, uncomment
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   107
% the following command: 
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   108
%\beamerdefaultoverlayspecification{<+->}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   109
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   110
%\includeonlyframes{current,current1,current2,current3,current4,current5,current6}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   111
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   112
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   113
% DOCUMENT STARTS
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   114
\begin{document}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   115
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   116
\begin{frame}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   117
  \titlepage
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   118
\end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   119
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   120
\begin{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   121
  \frametitle{Outline}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   122
  \tableofcontents
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   123
  % You might wish to add the option [pausesections]
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   124
\end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   125
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   126
\section{Functions}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   127
\subsection{Default arguments}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   128
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   129
  \frametitle{Functions: default arguments}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   130
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   131
In []: greet = 'hello world'
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   132
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   133
In []: greet.split()
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   134
Out[]: ['hello', 'world']
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   135
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   136
In []: line = 'Rossum, Guido, 54, 46, 55'
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   137
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   138
In []: line.split(',')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   139
Out[]: ['Rossum', ' Guido', ' 54',
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   140
                        ' 46', ' 55']
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   141
  \end{lstlisting}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   142
\end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   143
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   144
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   145
  \frametitle{Functions: default arguments \ldots}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   146
  \small
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   147
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   148
def ask_ok(prompt, complaint='Yes or no!'):
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   149
    while True:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   150
        ok = raw_input(prompt)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   151
        if ok in ('y', 'ye', 'yes'):
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   152
            return True
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   153
        if ok in ('n', 'no', 'nop',
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   154
                            'nope'):
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   155
            return False
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   156
        print complaint
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   157
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   158
ask_ok('?')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   159
ask_ok('?', '[Y/N]')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   160
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   161
\end{frame} 
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   162
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   163
\subsection{Keyword arguments}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   164
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   165
  \frametitle{Functions: Keyword arguments}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   166
We have seen the following
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   167
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   168
In []: legend(['sin(2y)'],
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   169
              loc='center')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   170
In []: plot(y, sin(y), 'g',
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   171
                 linewidth=2)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   172
In []: annotate('local max',
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   173
                 xy=(1.5, 1))
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   174
In []: pie(science.values(),
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   175
            labels=science.keys())
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   176
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   177
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   178
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   179
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   180
  \frametitle{Functions: keyword arguments \ldots}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   181
  \small
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   182
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   183
def ask_ok(prompt, complaint='Yes or no!'):
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   184
    while True:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   185
        ok = raw_input(prompt)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   186
        if ok in ('y', 'ye', 'yes'):
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   187
            return True
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   188
        if ok in ('n', 'no', 'nop',
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   189
                            'nope'):
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   190
            return False
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   191
        print complaint
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   192
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   193
ask_ok(prompt='?')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   194
ask_ok(prompt='?', complaint='[y/n]')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   195
ask_ok(complaint='[y/n]', prompt='?')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   196
\end{lstlisting}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   197
\end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   198
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   199
\subsection{Built-in functions}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   200
\begin{frame}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   201
  {Before writing a function}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   202
  \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   203
      \item Variety of builtin functions are available
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   204
      \item \typ{abs, any, all, len, max, min}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   205
      \item \typ{pow, range, sum, type}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   206
      \item Refer here:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   207
          \url{http://docs.python.org/library/functions.html}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   208
  \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   209
  \inctime{10} 
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   210
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   211
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   212
\subsection{Exercises}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   213
\begin{frame}{Problem set 3: Problem 3.1}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   214
  Write a function to return the gcd of two numbers.
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   215
\end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   216
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   217
\begin{frame}{Problem 3.2}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   218
Write a program to print all primitive pythagorean triads (a, b, c) where a, b are in the range 1---100 \\
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   219
A pythagorean triad $(a,b,c)$ has the property $a^2 + b^2 = c^2$.\\By primitive we mean triads that do not `depend' on others. For example, (4,3,5) is a variant of (3,4,5) and hence is not primitive. And (10,24,26) is easily derived from (5,12,13) and is also not primitive.
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   220
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   221
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   222
\begin{frame}{Problem 3.3}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   223
  Write a program that generates a list of all four digit numbers that have all their digits even and are perfect squares.\newline\\\emph{For example, the output should include 6400 but not 8100 (one digit is odd) or 4248 (not a perfect square).}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   224
\inctime{15}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   225
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   226
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   227
\section{Modules}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   228
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   229
  \frametitle{\typ{from} \ldots \typ{import} magic}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   230
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   231
from scipy.interpolate import splrep
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   232
from scipy.interpolate import splev
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   233
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   234
from scipy.integrate import quad
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   235
from scipy.integrate import odeint
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   236
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   237
from scipy.optimize import fsolve
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   238
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   239
\emphbar{All the above statements import one function into your namespace}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   240
\end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   241
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   242
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   243
  \frametitle{Running scripts from command line}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   244
  \small
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   245
  \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   246
    \item Start cmd
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   247
    \item cd to Desktop
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   248
    \item python sine\_plot.py
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   249
  \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   250
  \pause
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   251
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   252
Traceback (most recent call last):
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   253
  File "sine_plot.py", line 1, in <module>
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   254
    x = linspace(-5*pi, 5*pi, 500)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   255
NameError: name 'linspace' is not defined
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   256
  \end{lstlisting}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   257
\end{frame}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   258
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   259
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   260
  \frametitle{Remedy}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   261
  \emphbar{Adding what lines to sine\_plot.py makes this program work?}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   262
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   263
from scipy import *
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   264
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   265
\alert{Now run python sine\_plot.py again!}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   266
  \pause
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   267
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   268
Traceback (most recent call last):
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   269
  File "sine_plot.py", line 4, in <module>
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   270
    plot(x, x, 'b')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   271
NameError: name 'plot' is not defined
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   272
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   273
\end{frame}
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   274
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   275
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   276
  \frametitle{Remedy \ldots}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   277
  \emphbar{What should we add now?}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   278
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   279
from pylab import *
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   280
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   281
\alert{Now run python sine\_plot.py again!!}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   282
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   283
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   284
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   285
  \frametitle{Modules}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   286
  \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   287
    \item The \kwrd{import} keyword ``loads'' a module
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   288
    \item One can also use:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   289
      \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   290
In []: from scipy import *
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   291
In []: from scipy import linspace
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   292
      \end{lstlisting}    
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   293
    \item What is the difference?
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   294
    \item \alert{Use the former only in interactive mode}
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   295
    \end{itemize}
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   296
\end{frame}
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   297
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   298
\begin{frame}[fragile]
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   299
  \frametitle{Package hierarchies}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   300
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   301
from scipy.interpolate import splev
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   302
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   303
from scipy.integrate import quad
263
8a4a1e5aec85 Changes made for Goa workshop .
Shantanu <shantanu@fossee.in>
parents: 256
diff changeset
   304
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   305
from scipy.optimize import fsolve
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   306
  \end{lstlisting}
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   307
\end{frame}
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   308
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   309
\begin{frame}[fragile]
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   310
  \frametitle{from \ldots import in a conventional way!}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   311
  \small
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   312
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   313
from scipy import linspace, pi, sin
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   314
from pylab import plot, legend, annotate
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   315
from pylab import xlim, ylim
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   316
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   317
x = linspace(-5*pi, 5*pi, 500)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   318
plot(x, x, 'b')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   319
plot(x, -x, 'b')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   320
plot(x, sin(x), 'g', linewidth=2)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   321
plot(x, x*sin(x), 'r', linewidth=3)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   322
legend(['x', '-x', 'sin(x)', 'xsin(x)'])
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   323
annotate('origin', xy = (0, 0))
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   324
xlim(-5*pi, 5*pi)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   325
ylim(-5*pi, 5*pi)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   326
  \end{lstlisting}
171
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   327
\end{frame}
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   328
29c0c504750c Added some changes suggested during the review.
Shantanu <shantanu@fossee.in>
parents: 154
diff changeset
   329
\begin{frame}[fragile]
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   330
  \frametitle{from \ldots import in a conventional way!}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   331
  \small
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   332
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   333
import scipy
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   334
import pylab
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   335
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   336
x = scipy.linspace(-5*scipy.pi, 5*scipy.pi, 500)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   337
pylab.plot(x, x, 'b')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   338
pylab.plot(x, -x, 'b')
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   339
pylab.plot(x, scipy.sin(x), 'g', linewidth=2)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   340
pylab.plot(x, x*scipy.sin(x), 'r', linewidth=3)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   341
pylab.legend(['x', '-x', 'sin(x)', 'xsin(x)'])
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   342
pylab.annotate('origin', xy = (0, 0))
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   343
pylab.xlim(-5*scipy.pi, 5*scipy.pi)
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   344
pylab.ylim(-5*scipy.pi, 5*scipy.pi)
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   345
  \end{lstlisting}
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   346
\end{frame}
219
f6725f6bee41 Session 4, Debugging and Testing.
Shantanu <shantanu@fossee.in>
parents: 215
diff changeset
   347
f6725f6bee41 Session 4, Debugging and Testing.
Shantanu <shantanu@fossee.in>
parents: 215
diff changeset
   348
\begin{frame}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   349
  \frametitle{Modules: Standard library}
220
15306dad3b81 Corrections to day1 Session1, day2 Session 3 and 4.
Shantanu <shantanu@fossee.in>
parents: 219
diff changeset
   350
  \begin{itemize}
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   351
  \item Very powerful, ``Batteries included''
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   352
  \item Some standard modules:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   353
    \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   354
    \item Math: \typ{math}, \typ{random}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   355
    \item Internet access: \typ{urllib2}, \typ{smtplib}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   356
    \item System, Command line arguments: \typ{sys}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   357
    \item Operating system interface: \typ{os}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   358
    \item Regular expressions: \typ{re}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   359
    \item Compression: \typ{gzip}, \typ{zipfile}, and \typ{tarfile}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   360
    \item And a whole lot more!
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   361
    \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   362
  \item Check out the Python Library reference:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   363
    \url{http://docs.python.org/library/}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   364
  \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   365
\inctime{5}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   366
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   367
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   368
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   369
  \frametitle{Modules of special interest}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   370
  \begin{description}[matplotlibfor2d]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   371
    \item[\typ{pylab}] Easy, interactive, 2D plotting
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   372
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   373
    \item[\typ{scipy}] arrays, statistics, optimization, integration, linear
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   374
            algebra, Fourier transforms, signal and image processing,
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   375
            genetic algorithms, ODE solvers, special functions, and more
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   376
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   377
    \item[\typ{Mayavi}] Easy, interactive, 3D plotting
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   378
  \end{description}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   379
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   380
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   381
\section{Objects}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   382
\begin{frame}{Everything is an Object!}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   383
  \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   384
    \item \typ{int}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   385
    \item \typ{float}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   386
    \item \typ{str}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   387
    \item \typ{list}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   388
    \item \typ{tuple}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   389
    \item \typ{string}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   390
    \item \typ{dictionary}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   391
    \item \typ{function}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   392
    \item User defined class is also an object!
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   393
  \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   394
\end {frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   395
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   396
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   397
\frametitle{Using Objects}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   398
  \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   399
    \item Creating Objects
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   400
    \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   401
      \item Initialization
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   402
    \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   403
    \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   404
In []: a = str()
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   405
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   406
In []: b = "Hello World"
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   407
    \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   408
    \item Object Manipulation
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   409
    \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   410
      \item Object methods
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   411
      \item ``.'' operator
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   412
    \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   413
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   414
In []: "Hello World".split()
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   415
Out[]: ['Hello', 'World']
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   416
    \end{lstlisting}
220
15306dad3b81 Corrections to day1 Session1, day2 Session 3 and 4.
Shantanu <shantanu@fossee.in>
parents: 219
diff changeset
   417
  \end{itemize}
219
f6725f6bee41 Session 4, Debugging and Testing.
Shantanu <shantanu@fossee.in>
parents: 215
diff changeset
   418
\end{frame}
220
15306dad3b81 Corrections to day1 Session1, day2 Session 3 and 4.
Shantanu <shantanu@fossee.in>
parents: 219
diff changeset
   419
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   420
\begin{frame}[fragile]
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   421
  \frametitle{Objects provide consistency}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   422
  \small
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   423
  \begin{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   424
for element in (1, 2, 3):
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   425
    print element
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   426
for key in {'one':1, 'two':2}:
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   427
    print key
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   428
for char in "123":
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   429
    print char
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   430
for line in open("myfile.txt"):
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   431
    print line
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   432
for line in urllib2.urlopen('http://site.com'):
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   433
    print line
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   434
  \end{lstlisting}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   435
  \inctime{10}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   436
\end{frame}
154
66b117b7edc7 Added slides for 3D data visualization session 3 day 2.
Shantanu <shantanu@fossee.in>
parents:
diff changeset
   437
288
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   438
\begin{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   439
  \frametitle{What did we learn?}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   440
  \begin{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   441
    \item Functions: Default and Keyword arguments
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   442
    \item Modules
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   443
    \item Objects
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   444
  \end{itemize}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   445
\end{frame}
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   446
c4e25269a86c Reorganized slides.
Madhusudan.C.S <madhusudancs@gmail.com>
parents: 263
diff changeset
   447
\end{document}