Open main menu

CDOT Wiki β

Changes

OPS435 Python Lab 5

4 bytes added, 16:45, 4 September 2017
INVESTIGATION 1: Working with Files
dir(f)
</source>
:#Although the '''dir(f)''' function displays a lot of information, we will focus on only a few elements. Issue all of Separately issue the following commands in order to inspect some of the '''functions'''. '''attributes''' and '''methods''' that we can use with this file object:<source lang="python">
help(f.read) # help for reading all lines and stores in a string
help(f.readlines) # help for reading all lines and stores in a list
13,420
edits