[Tutor] Parsing data from a set of files iteratively
steve at pearwood.info
Wed May 30 02:09:28 CEST 2012
Steven D'Aprano wrote:
> location = '/Users/spyros/Desktop/3NY8MODELSHUMAN/HomologyModels/'
> zdata = 
> for filename in os.listdir(location):
Hah, that can't work. listdir returns the name of the file, but not the file's
path, which means that Python will only look in the current directory. You
need something like this:
location = '/Users/spyros/Desktop/3NY8MODELSHUMAN/HomologyModels/'
zdata = 
for filename in os.listdir(location):
Sorry about that.
More information about the Tutor