python 的一些常用功能

来源:互联网 发布:yyp2p电脑监控软件 编辑:程序博客网 时间:2024/05/04 09:58


1  pyhon3的对文件系统的变化监控功能


import timedef handle(*args):     print(args[0],args[1])#    fsw = FileSystemWatcher("c:/aaa/output")     #dir = "c:/aaa/output"        import watcherdir = "C:/aaa/output"dir = "N:/data"w = watcher.Watcher(dir, handle)#w.flags = watcher.FILE_NOTIFY_CHANGE_FILE_NAMEw.flags = watcher.FILE_NOTIFY_CHANGE_CREATION | watcher.FILE_NOTIFY_CHANGE_FILE_NAMEw.recursive=Trueprint("program start...")w.start()time.sleep(60*60*60)print("program exit...")
注意:1 用cxfreeze watcher.py --target-dir dist 生成exe时候,dist目录中的watcher._watcher.pyd要随产品一起发布

      

0 0
原创粉丝点击