diff options
Diffstat (limited to 'getting_started_with_files')
-rw-r--r-- | getting_started_with_files/script.rst | 28 | ||||
-rw-r--r-- | getting_started_with_files/slides.org | 8 | ||||
-rw-r--r-- | getting_started_with_files/slides.tex | 27 |
3 files changed, 44 insertions, 19 deletions
diff --git a/getting_started_with_files/script.rst b/getting_started_with_files/script.rst index 22b5ddc..3ebbbba 100644 --- a/getting_started_with_files/script.rst +++ b/getting_started_with_files/script.rst @@ -48,6 +48,8 @@ At the end of this tutorial, you will be able to, .. L3 +{{{ Show slide with pre-requisite }}} + {{{ switch to the terminal }}} :: @@ -55,6 +57,9 @@ At the end of this tutorial, you will be able to, .. R3 +Before beginning this tutorial,we would suggest you to complete the +tutorial on "Getting started with Lists" and "Getting started with For". + Open the terminal and start ipython .. R4 @@ -117,7 +122,7 @@ to see more explicitly, what it contains. .. L10 -{{{ show slide with Question 1 }}} +{{{ show slide with exercise 1 }}} .. R10 @@ -168,7 +173,7 @@ opened, after their job is done. .. L15 -{{{ Show slide with Question 2 }}} +{{{ Show slide with exercise 2 }}} .. R15 @@ -248,8 +253,8 @@ with the newline characters. If you noticed, ``pend_list`` did not contain the newline characters, because the string ``pend``, was split on the newline characters. -We can strip out the newline characters from the lines by using some string methods -which we shall look in the further tutorial on strings. +We can strip out the newline characters from the lines by using some +string methods which we shall look in the further tutorial on strings. .. L22 @@ -259,14 +264,17 @@ which we shall look in the further tutorial on strings. .. R23 -This brings us to the end of this tutorial. In this tutorial, we learnt to, +This brings us to the end of this tutorial. In this tutorial, we +learnt to, - 1. Open and close files using the ``open`` and ``close`` functions respectively. + 1. Open and close files using the ``open`` and ``close`` functions + respectively. #. Read the data in the files as a whole,by using the ``read`` function. - #. Read the data in the files line by line by iterating over the file object using the + #. Read the data in the files line by line by iterating over the file + object using the ``for`` loop. - #. Append the lines of a file to a list using the ``append`` function within the - ``for`` loop. + #. Append the lines of a file to a list using the ``append`` function + within the ``for`` loop. .. L24 @@ -306,6 +314,6 @@ And the answers, .. R26 -Hope you have enjoyed and found it useful. +Hope you have enjoyed this tutorial and found it useful. Thank you! diff --git a/getting_started_with_files/slides.org b/getting_started_with_files/slides.org index 2321329..1300db2 100644 --- a/getting_started_with_files/slides.org +++ b/getting_started_with_files/slides.org @@ -53,10 +53,14 @@ - Read the entire content of file at once. - Append the lines of a file to a list. - Close the file. -* Question 1 +* Pre-requisite + Spoken tutorial on - + - Getting started with Lists. + - Getting started with For. +* Exercise 1 Split the variable into a list, =pend_list=, of the lines in the file. -* Question 2 +* Exercise 2 Re-open the file =pendulum.txt= with =f= as the file object. * Summary In this tutorial, we have learnt to – diff --git a/getting_started_with_files/slides.tex b/getting_started_with_files/slides.tex index 56582b4..9ba507f 100644 --- a/getting_started_with_files/slides.tex +++ b/getting_started_with_files/slides.tex @@ -1,4 +1,4 @@ -% Created 2011-05-18 Wed 12:37 +% Created 2011-05-24 Tue 11:43 \documentclass[presentation]{beamer} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} @@ -72,21 +72,32 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries} \end{itemize} \end{frame} \begin{frame} -\frametitle{Question 1} +\frametitle{Pre-requisite} \label{sec-3} + Spoken tutorial on - + +\begin{itemize} +\item Getting started with Lists. +\item Getting started with For. +\end{itemize} +\end{frame} +\begin{frame} +\frametitle{Exercise 1} +\label{sec-4} + Split the variable into a list, \texttt{pend\_list}, of the lines in the file. \end{frame} \begin{frame} -\frametitle{Question 2} -\label{sec-4} +\frametitle{Exercise 2} +\label{sec-5} Re-open the file \texttt{pendulum.txt} with \texttt{f} as the file object. \end{frame} \begin{frame} \frametitle{Summary} -\label{sec-5} +\label{sec-6} In this tutorial, we have learnt to – @@ -101,7 +112,7 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries} \end{frame} \begin{frame} \frametitle{Evaluation} -\label{sec-6} +\label{sec-7} \begin{enumerate} @@ -112,6 +123,7 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries} \item file object \item function \end{itemize} +\vspace{8pt} \item What does the function ``splitlines()`` do. \begin{itemize} \item Displays the data as strings,all in a line @@ -122,11 +134,12 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries} \end{frame} \begin{frame} \frametitle{Solutions} -\label{sec-7} +\label{sec-8} \begin{enumerate} \item file object +\vspace{10pt} \item Displays the data line by line as strings \end{enumerate} \end{frame} |