2016-04-08 17 views
0

Bu temel bir istemci sunucu soket programıdır. İstemci sunucuya dosya gönderir ve sunucu gedit'i kullanarak açar.gedit'te bir metin dosyasının açık olup olmadığını nasıl kontrol edilir

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

Ben kodu

while file_open in gedit: 
      wait() 
after file_closed and saved 
      send to client 
sanırım
+0

Olası kopyası [Python: Dosya kontrol ediliyor] (http://stackoverflow.com/questions/13371444/python-check-file-is-locked) – CarlosCarucce

cevap

0
while p.is_alive(): 
    ... 

gibi çalışmak istiyorum ... ama bu gerçekten sadece ... onlar açıktır (gedit) süreci olduğu sürece devam edecektir Bu dosyayı kapatmış olabilir ...

İlgili konular