0

So this is a basic client server socket program.The client sends the file to the server and the server opens it using gedit.

p = subprocess.Popen("gedit file", shell=True, stdout=subprocess.PIPE,stderr=subprocess.STDOUT)

I want the code to work like

while file_open in gedit:
            wait()
after file_closed and saved
            send to client
Jason
  • 2,278
  • 2
  • 17
  • 25
  • Possible duplicate of [Python : Check file is locked](http://stackoverflow.com/questions/13371444/python-check-file-is-locked) – CarlosCarucce Apr 08 '16 at 17:11

1 Answers1

0
while p.is_alive():
    ...

I guess... but that will really just keep going as long as the process (gedit) is open ... they may have closed that specific file ...

Joran Beasley
  • 110,522
  • 12
  • 160
  • 179