Again, I apologise. Not knowing much about Python means that I don't know what needs to be provided. I meant it doesn't work in the same way that "istdir" didn't work.
Here is what I have coded: for subdir in os.path.istdir(DATADIR): #loop through list of strings file=FITS.Read(DATADIR+'/'+subdir+'/flux.fits') #opens flux.fits file and reads summation=open(DATADIR+'/'+subdir+'/flux.dat','w') #opens the summation results file for writing to spotbyspot=open(DATADIR+'/'+subdir+'/spotflux.dat','w') #opens the spot-by-spot file for writing to output='' print'\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n'+sys.argv[1]+' '+subdir+'\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n' And here is what I get when I try to run it: Traceback (most recent call last): File "katiescint.py", line 153, in ? for subdir in os.path.istdir(DATADIR): #loop through list of strings AttributeError: 'module' object has no attribute 'istdir' Here is trying with listdir: for subdir in os.path.listdir(DATADIR): #loop through list of strings and here is what I get: Traceback (most recent call last): File "katiescint.py", line 153, in ? for subdir in os.path.listdir(DATADIR): #loop through list of strings AttributeError: 'module' object has no attribute 'listdir' Sybren Stuvel wrote: > k r fry enlightened us with: > >>I did think maybe it was meant to be "listdir" instead of "istdir", >>but that doesn't work either. > > > And again you don't tell us in what way it doesn't work. > > Think about what you post from our point of view. Then re-read it, and > think about it again. Only if you're sure that we'll be able to fully > understand it, hit the 'send' button. That will save us a lot of > guessting and asking, and will also get you your answer a lot faster. > > Sybren -- http://mail.python.org/mailman/listinfo/python-list