DOC: Add a few slides on namespaces and imports. scipy2010
authorChristopher Burns <chris.d.burns@gmail.com>
Mon, 28 Jun 2010 23:52:18 -0500
branchscipy2010
changeset 429 58a2d1766197
parent 428 ee689f7c3122
child 430 f97ecb4e04a9
DOC: Add a few slides on namespaces and imports.
day2/session3.tex
--- a/day2/session3.tex	Mon Jun 28 23:17:31 2010 -0500
+++ b/day2/session3.tex	Mon Jun 28 23:52:18 2010 -0500
@@ -285,6 +285,27 @@
 \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 @@
   \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}