<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\textbf{Getting Started -- files}

\lstinline|f = open('filename')| returns a file object. \lstinline|f|
can be used to perform further operations on the file. 

\lstinline|f.read()| reads the whole file and returns the contents. 

\lstinline|f.close()| closes the file. 

\lstinline|for line in open('filename'):| -- iterate over the file
line-by-line. 

</pre></body></html>