How to do notifications with Python 3.3?

老子叫甜甜 提交于 2019-12-11 11:17:24

问题


I'm working on a python app that needs a notification when there's a change in a directory structure; e.g., someone drops a file in a folder or changes a file name. Reading up on Watchdog, it looks like it does just what I need except that I'm working in Python 3.3 and Watchdog doesn't seem to have been updated. Below is the tail end of an error dump from a watchdog sample file.

File "C:\Program Files\Python33\lib\site-packages\watchdog-0.6.0-py3.3.egg\watchdog\utils\bricks.py", line 112, in <module>
  if not sys.version < (2, 6, 0):
TypeError: unorderable types: str() < tuple()

I just tried installing Pyinotify but got an error saying it's not available with Win64. How does one go about receiving notifications with Python 3.3 and Win64?


回答1:


sys.version is a str. You should use tuple and sys.version_info is what you need.



来源:https://stackoverflow.com/questions/16863075/how-to-do-notifications-with-python-3-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!