Electron microscopy
 
Simple Watchdog to Monitor File/Folder Changes
- Integrated Circuits -
- An Online Book -
Integrated Circuits                                                                                   http://www.globalsino.com/ICs/        


=================================================================================

 

====================================================

Watchdog in Python can be used to monitor folders and files. However, a potential program of using watchdog is that the file of watchdog table (entries) can be very large, e.g. it can be hundreds of Gb with many redundant/not useful messages, with time or too many files in the folder. Watchdog Prune module can be used to clean the wachdog log file by setting the historical data with dates.

====================================================

Very simple watchdog script to monitor the creation of folder and files in the direct folder only: code:
         Monitor changes in a folder
Output:
         Monitor changes in a folder

====================================================

Script ranking: Number One. Monitor file creation and then write the file paths into the text file: code:
          Call and then run your own functions and modules in different Python files
     Output:
         Call and then run your own functions and modules in different Python files

====================================================

Monitor the current folder:  code:
          Call and then run your own functions and modules in different Python files
     Output:
         Call and then run your own functions and modules in different Python files

====================================================

Monitor and display any events in a folder in a very simple format: code:
         Monitor changes in a folder
Output:
         Monitor changes in a folder

====================================================

Monitor and display different events in a folder in a simple format: code:
         Monitor changes in a folder
Output:
         Monitor changes in a folder

====================================================

Monitor changes in a folder: code:
         Monitor changes in a folder

====================================================

Monitor changes in a folder: code:
         Monitor changes in a folder

====================================================

Sort/move files, which was pasted to desktop, to specific folders: code:
         Monitor changes in a folder

====================================================

Troubleshooting of programs with the watchdog module:
         i) Error message after running a script with watchdog: ModuleNotFoundError: No module named 'watchdog.observers'; 'watchdog' is not a package.
         ii) Origin A of the error cause: the file for monitoring a folder is named as watchdog.py.
         iii) Origin B of the error cause: a file with name of watchdog.py in the script folder for a monitoring folder.
         iv) Origin C of the error cause: In the path (C:\Anaconda3\Lib\site-packages) of Anaconda, there is no watchdog module; then copy the two modules (watchdog and watchdog-0.8.3-py3.6egg) in the path of C:\Python36\Lib\site-packages to C:\Anaconda3\Lib\site-packages.       

====================================================

Use tkinter pop-up window to display the file/folder change in a direct folder: code:
         Monitor changes in a folder
         Monitor changes in a folder
Output:         
         Monitor changes in a folder
         Monitor changes in a folder
           

 

 

=================================================================================