2016-04-08 16 views
0

これは基本的なクライアントサーバーソケットプログラムです。クライアントはファイルをサーバーに送信し、サーバーはgeditを使用してファイルを開きます。テキストファイルがgeditで開いているかどうかを確認する方法

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

私はコードが

while file_open in gedit: 
      wait() 
after file_closed and saved 
      send to client 
私は推測
+0

[Python:ファイルがロックされています]の可能な複製(http://stackoverflow.com/questions/13371444/python-check-file-is-locked) – CarlosCarucce

答えて

0
while p.is_alive(): 
    ... 

のように仕事をしたい...しかし、それは本当にただ...彼らが開いている(geditの)プロセス限り続けるだろうその特定のファイルを閉じている可能性があります...

関連する問題