getting-started-files/quickref.tex
changeset 324 4054b1a6392d
parent 285 7c4855fb8e5f
--- a/getting-started-files/quickref.tex	Wed Oct 13 17:32:23 2010 +0530
+++ b/getting-started-files/quickref.tex	Wed Oct 13 17:32:59 2010 +0530
@@ -1,8 +1,12 @@
-Creating a linear array:\\
-{\ex \lstinline|    x = linspace(0, 2*pi, 50)|}
+\textbf{Getting Started -- files}
+
+\lstinline|f = open('filename')| returns a file object. \lstinline|f|
+can be used to perform further operations on the file. 
 
-Plotting two variables:\\
-{\ex \lstinline|    plot(x, sin(x))|}
+\lstinline|f.read()| reads the whole file and returns the contents. 
+
+\lstinline|f.close()| closes the file. 
 
-Plotting two lists of equal length x, y:\\
-{\ex \lstinline|    plot(x, y)|}
+\lstinline|for line in open('filename'):| -- iterate over the file
+line-by-line. 
+