python程序跨平台桌面_Python中的跨平台桌面通知程序
在2010年的Pycon大會上有一個presentation on cross-platform Python development。
還有一個關于它的html頁面,其中包含一些跨平臺通知的建議。但是,我在網上找不到它了,但我保存了一個本地副本,這是關于通知的部分:There are occasions in which your application wants to notify the user
about something: software updates are available, a new instant message
have been received, the 300 page print job has finally finished, etc.To keep notifications easy to port cross-platform, don't make
them interactive. For example Ubuntu does not support notifications
that require user interaction.
These are the most important libraries:
o Linux: pynotify.
o Mac OS X: Growl, which is not standard, is usually
installed.
o Windows: a good wxPython solution is ToasterBox of Andrea
Gavana, which mimics the look of Firefox or Thunderbird notifications.
For Phatch we developed a library that unifies these three
systems in one API: phatch/lib/notify.py.
鏈接的python文件非常有趣,我認為您應該能夠像現在這樣使用鏈接的python文件。代碼也非常清楚,所以您將很快看到它的作用。
最基本的方法是檢測哪些通知系統可用,幾乎與平臺無關,并嘗試按特定順序使用它們,但如果需要,可以返回到更簡單的系統。這樣,如果用戶安裝了例如Growl的軟件,不管平臺是什么,它都會使用它。
您可以對其進行調整,以便為上述三種通知系統之外的其他通知系統提供支持。
總結
以上是生活随笔為你收集整理的python程序跨平台桌面_Python中的跨平台桌面通知程序的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ssh查找linux端口,linux –
- 下一篇: 徐州初中计算机学校排名2015,徐州初中