Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.

Well done!

You have completed (UPI) Chapter 16: Working with Files in Python!

Instruction

Opening a file at any location

When only the filename is used as the argument to the open() function, the file must be in the same folder as the Python file that is executing. Example: For fileobj = open("file1.txt") in files.py to execute successfully, the file1.txt file should be in the same folder as files.py.

Often a programmer needs to open files from folders other than the one in which the Python file ...