Electron microscopy
 
Monitor Specific New Files and Execute the File
- Python for Integrated Circuits -
- An Online Book -
Python for Integrated Circuits                                                                                   http://www.globalsino.com/ICs/        


Chapter/Index: Introduction | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | Appendix

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

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

Monitor a specific new files and execute the file, and then re-start the monitoring program itself to continue its monitoring by standby: code:
          Move files from one directory to another (the file must already exist)         
Output and steps:          
Step 1: The folder          
         Move files from one directory to another (the file must already exist)
Step 2: Paste a file
         Move files from one directory to another (the file must already exist)
Step 3: output (had called and run another file)         
         Move files from one directory to another (the file must already exist)
Step 4: one more layer of the foler            
         Move files from one directory to another (the file must already exist)
Step 5: paste two files            
         Move files from one directory to another (the file must already exist)
Step 6: second output together with the first output           
         Move files from one directory to another (the file must already exist)
Step 7: free the folder again          
         Move files from one directory to another (the file must already exist)
Step 8: paste the file one more time          
         Move files from one directory to another (the file must already exist)
Step 9:  Added one more output
         Move files from one directory to another (the file must already exist)

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

Monitor a specific new files and execute the file, and then re-start the monitoring program itself to continue its monitoring by standby (note: this program only has one line difference from the one above, but it acts the same way as the one above): code:
          Move files from one directory to another (the file must already exist)

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

Script ranking: Number 1A. Observer runs in the background and pass the value of obtained events to a/another function call. Note this code has two advantages:
        i) The monitoring program wit watchdog does not stop when the other program crashes because of "exec(open) command".
        ii) The monitoring program executes other programs in series.
          Code:
                main code
          Output (Failed at running the second function "SimpleCal2" but the the program running in background still runs and still calls functions when new files are uploaded even though there was a failure from calling "SimpleCal2"):
                main code

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

Monitor a specific new files and execute the file, and then re-start the monitoring program itself to continue its monitoring by standby (note: this program only has one line difference from the one above, but it acts the same way as the one above): code:
          Move files from one directory to another (the file must already exist)     

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

Monitor specific new files and execute the file: code:
          Move files from one directory to another (the file must already exist)
          Move files from one directory to another (the file must already exist)
Output:          
         Move files from one directory to another (the file must already exist)
Output below once there is a new pdf file in "Downloads" folder:          
         Move files from one directory to another (the file must already exist)

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

Monitor specific new files and execute another file: code 1; and Create a .txt file with calling by another file: code 2:
    Code 1 (the lines marked in red below can avoid secondary excution of the Code 2 file, trigered by the .txt file created by Code 2) -- Warning: this package can be not stable in some cases:
          Move files from one directory to another (the file must already exist)
     Code 2:
          Move files from one directory to another (the file must already exist)         
Before excuting Code 1:          
         Move files from one directory to another (the file must already exist)
After excuting Code 1:          
         Move files from one directory to another (the file must already exist)
After copying the two files in the red circle into the folder, the .txt file was generated by Code 2 since the file "ImagePool (12).jpg" was included:          
         Move files from one directory to another (the file must already exist) 
         Move files from one directory to another (the file must already exist)
In contrast, after copying the four files below into the folder, no .txt file was generated by Code 2 since the file "ImagePool (12).jpg" was not included:          
         Move files from one directory to another (the file must already exist) 
         Move files from one directory to another (the file must already exist)

 

         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         

 

 

 

 

 

 

 

 

 

 

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