November 2017
Beginner to intermediate
204 pages
5h 23m
English
To open a file, you can use Python's built-in open() function:
file = open("<relative/path/to/file>", "<permission>")
The variable named file in the previous example is what the documentation calls a file object. A file object doesn't actually contain the contents of the file, rather it is used to access the file's location in memory and give the program permission to operate on the file. The file object is generally used as a parameter to other functions that read the data.
The first parameter of the open() function is a string containing the relative path from the directory in which the program is run to the file containing your data.
The second parameter is the permission, which is a string designating ...
Read now
Unlock full access