COSC 235: Programming and Problem Solving
February 25, 2009

Joseph D. Sloan
sloanjd @ wofford.edu


Files

Be sure to get file names correct. It is generally easier to work in the current directory. You can verify the current directory with these commands:

import os
os.getcwd()

To change the working directory, use the following syntax (substituting the directory you want):

import os
os.chdir("C:\\")

Remember, there are four commands to read files. The format of what is read is very important!

Code from Class


This page was created by Joe Sloan.
It was last modified around: 25 February 2009
Send mail to: sloanjd@wofford.edu