summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Burns2010-06-28 23:52:18 -0500
committerChristopher Burns2010-06-28 23:52:18 -0500
commitd05a2e97f02d6c8f600564d34634badea82950b0 (patch)
tree201e0edcdd7828eb67f60235566242eeb6a141ed
parent70258fdab869212582e46e39b7794f604a554779 (diff)
downloadworkshops-d05a2e97f02d6c8f600564d34634badea82950b0.tar.gz
workshops-d05a2e97f02d6c8f600564d34634badea82950b0.tar.bz2
workshops-d05a2e97f02d6c8f600564d34634badea82950b0.zip
DOC: Add a few slides on namespaces and imports.
--HG-- branch : scipy2010
-rw-r--r--day2/session3.tex34
1 files changed, 34 insertions, 0 deletions
diff --git a/day2/session3.tex b/day2/session3.tex
index a3808f7..463f22a 100644
--- a/day2/session3.tex
+++ b/day2/session3.tex
@@ -285,6 +285,27 @@ In []: from scipy import linspace
\end{frame}
\begin{frame}[fragile]
+ \frametitle{IPython namespace}
+ \begin{lstlisting}
+
+In [4]: whos
+Interactive namespace is empty.
+
+ \end{lstlisting}
+\end{frame}
+
+\begin{frame}[fragile]
+ \frametitle{IPython namespace}
+ \begin{lstlisting}
+
+In [5]: from numpy import *
+
+In [6]: whos
+
+ \end{lstlisting}
+\end{frame}
+
+\begin{frame}[fragile]
\frametitle{Package hierarchies}
\begin{lstlisting}
from scipy.integrate import odeint
@@ -332,6 +353,19 @@ pylab.ylim(-5*scipy.pi, 5*scipy.pi)
\end{lstlisting}
\end{frame}
+\begin{frame}[fragile]
+ \frametitle{\texttt{import} - the community convention}
+ \begin{lstlisting}
+
+import numpy as np
+np.linspace(-5 * np.pi, 5 * np.pi, 500)
+
+import scipy as sp
+sp.linspace(-5 * sp.pi, 5 * sp.pi, 500)
+
+ \end{lstlisting}
+\end{frame}
+
\begin{frame}
\frametitle{Modules: Standard library}
\begin{itemize}