问题
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