Manyfile Processing

user at domain.invalid user at domain.invalid
Fri Dec 4 09:38:52 EST 2009


On 12/04/2009 12:58 PM, Dan Sommers wrote:
> On Fri, 04 Dec 2009 10:00:53 +0200, user wrote:
> 
>>  sorry if i bother you with a beginners question but i have an issue
>> with processing a bunch of files. They are some arithmetic lists the
>> processing of one file is an easy task but how do i process many files?
>> I tried reading that files in to a list and looping over the list
>> elements but the function won't accept any arguments other than a
>> string.
> 
> Maybe the fileinput module can help.
> 
> Dan
> 

Hi,

  seems like the fileinput module works fine for me though i am having
quite an issue with the paths.

if i do:


something = fileinput.input("/some/absolute/path/to/list/file.txt")
#the text file contains absolute paths
for line in something:
	data=scipy.io.array_import.read_array(line)
	print data

it claims that the paths given in the textfiles don't exist "no file or
directory" though taking one entry from the textfile and inserting it
directly to the command does its job...

Any idea?

Thanks so far



More information about the Python-list mailing list