<div dir="ltr">Hello folks,<br><br>I am creating a python script[windows vista and python2.5] which accesses another program(prog2).I my python script i am creating a temporary file and i write the output of prog2<br>in this temporary file.<br>
<br>temp = tempfile.NamedTemporaryFile(suffix='_suffix',prefix='prefix_',dir='C:\\Python25') - #this how create the temporary file ( i am not closing the temporary file).This works fine<br><br>x= os.path.split(tn)<br>
<br> y=x[1]<br><br>Now i search for the file and then try to read this file so that i can perform some calculations.<br><br>This step causes the problem<br>file=open(find_file,"rb") # find_file is the object returned after searching the file<br>
<br>error mesage:<br><br>the process cannot access the file as another process because it is being used by another program.(prog2 in this case)<br>i/o error 13 permission denied<br><br>Please help me on how can i fix this ? i am using os.system() in my program to communicate with prog2<br>
<br>Thanks in advance<br><br>Aditya<br><br><br></div>