如下 代码
class CustomFileSystemEventHandler(FileSystemEventHandler):
def on_modified(self, event):
# 处理文件或目录被修改的事件
if event.src_path=='D:\\test\\111.txt':
toaster = ToastNotifier()
toaster.show_toast("!通知!", f'File {event.src_path} has been modified')
else:
pass
path = 'D:\\test'
observer = Observer()
observer.schedule(CustomFileSystemEventHandler(), path, recursive=True)
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
observer.stop()
observer.join()
监控 D:\\test\\111.txt 修改后 桌面弹出通知,可以正常执行,但是 程序运行窗口会有提示 :
WNDPROC return value cannot be converted to LRESULT
TypeError: WPARAM is simple, so must be an int object (got NoneType)
请问改如何 修改 ?
class CustomFileSystemEventHandler(FileSystemEventHandler):
def on_modified(self, event):
# 处理文件或目录被修改的事件
if event.src_path=='D:\\test\\111.txt':
toaster = ToastNotifier()
toaster.show_toast("!通知!", f'File {event.src_path} has been modified')
else:
pass
path = 'D:\\test'
observer = Observer()
observer.schedule(CustomFileSystemEventHandler(), path, recursive=True)
observer.start()
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
observer.stop()
observer.join()
监控 D:\\test\\111.txt 修改后 桌面弹出通知,可以正常执行,但是 程序运行窗口会有提示 :
WNDPROC return value cannot be converted to LRESULT
TypeError: WPARAM is simple, so must be an int object (got NoneType)
请问改如何 修改 ?