[Tutor] files in a directory

kumar s ps_python at yahoo.com
Sun Jan 30 09:03:18 CET 2005


Hello.

I wrote a parser to parse spot intensities. The input
to this parser i am giving one single file

f1 = open('my_intensity_file.dml','r')
int = f1.read().split('\n')

my_vals  = intParser(int) 

intParser return a list
f2  = open('myvalues.txt','w')
for line in my_vals:
     f2.write(line)
     f2.write('\n')

f2.close()


The problem with this approach is that, i have to give
on file per a run. I have 50 files to pare and i want
to do that in one GO.  I kepy those 50 files in one
directory. Can any one suggest an approach to automate
this process. 

I tried to use f1 = stdin(...) it did not work. i dont
know , possible is that i am using incorrect syntax.

Any suggestions. 

Thank you. 
K






		
__________________________________ 
Do you Yahoo!? 
All your favorites on one personal page – Try My Yahoo!
http://my.yahoo.com 


More information about the Tutor mailing list