Calling a module in python to process the same file. It works in one scenario, but not in the other, and I can't figure out what's different -

as can see image above,i call txt_to_csv_space_split_version() module in script on top left , in script on bottom right. on top left, text file isn't read reason (output on top right), in bottom right, (output on bottom left).
i hope makes sense-please feel free ask clarification! many thanks!!
edit: green circles point module gets called in each of scripts. green rectangle highlights module definition. red circles show same text file being read (by same module) in both scripts. , yet, somehow, module doesn't seem working correctly script in top left.
you're opening file in upper left script 'w' mode, wipe it's contents out.
output_file=open("/users/markfisher/desktop/"+filenames[index]+'_output.txt','w') then call function opens file read it's contents:
name_to_be_split="/users/markfisher/desktop/"+filenames[index]+'_output.txt' #print transpose.txt_to_csv_space_split_version(name_to_be_split) index doesn't change during script, file name same.
at point file contents wiped out, there's nothing read. @ least that's gather multiple stuff put in picture :)
Comments
Post a Comment