File access

Larry Bates larry.bates at websafe.com
Thu Aug 2 14:11:51 EDT 2007


JD wrote:
> Hi,
> 
> What I am trying to do is to run a subprocess on another machine using
> subprocess.Popen, this subprocess contuinue writing something into a
> file when it is runing.
> 
> After submit this subprocess, I tried to open the file and readlines()
> in the loop (with a delay) in the loop) when the subprocess was
> runing.
> 
> The problem is I could not get anything untill the subprocess
> finished.
> 
> I also tried to run another python programm when the subprocess is
> runing, I could get what I want.
> 
> Does anyone know why? Thanks!
> 
> JD
> 

I believe you are approaching this incorrectly.  You should probably be using a
socket server/socket client to communicate between these two.  Or perhaps you
could use a multi-user database table.  Writing/reading to files from two
different workstations and expecting them to by synchronized most likely won't work.

-Larry



More information about the Python-list mailing list