开发者

Non-polling file monitoring in wxPython

开发者 https://www.devze.com 2022-12-15 05:58 出处:网络
I have a wxPython application that needs to know when a certain file gets deleted, but I\'d like to do it without having to use a \"polling\" technique开发者_JS百科.. Since this is a Linux-only app, I

I have a wxPython application that needs to know when a certain file gets deleted, but I'd like to do it without having to use a "polling" technique开发者_JS百科.. Since this is a Linux-only app, I thought I could use GIO, but it looks like it needs a call to gtk.main() and I can't do that because that'd stop the execution flow on the wxPython side...

Is there a workaround or an alternative way?

(Xubuntu 9.04, wxPython 2.8.9.1)


Pyinotify can do that

or you can run inotifywait in the background and have it send you a signal when the event occurs.

or perhaps roll your own with inotifywait() in C

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号