Electron microscopy
 
os.path.join(path
- Integrated Circuits -
- An Online Book -
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

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

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

os.path.join(path): Get a file path.

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

Prevent other applications to modify the content until other Python script runs: code:          
          Prevent other applications to modify the content until other Python script runs

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

Get the latest/newest/most recent file in a folder: code:          
          Get the latest/newest/most recent file in a folder

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

Screen shoot to a specific folder: code:          
          Prevent other applications to modify the content until other Python script runs
Output:         

          Prevent other applications to modify the content until other Python script runs

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

Write the contents of the Frame into a CSV file: code:          
          Prevent other applications to modify the content until other Python script runs

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

Create a new folder and then copy all files from a folder to the new folder and rename the file, and then open the file. If the folder exists, then no file will be copied, but the file will still be opened. Code:
        Create a new folder and then copy all files from a folder to the new folder and rename the file, and then open the file. If the folder exists, then no file will be copied, but the file will still be opened
Input:        
        Create a new folder and then copy all files from a folder to the new folder and rename the file, and then open the file. If the folder exists, then no file will be copied, but the file will still be opened        
Output 1:
        Create a new folder and then copy all files from a folder to the new folder and rename the file, and then open the file. If the folder exists, then no file will be copied, but the file will still be opened       
Output 2:
        Create a new folder and then copy all files from a folder to the new folder and rename the file, and then open the file. If the folder exists, then no file will be copied, but the file will still be opened

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

Select a folder for later use, e.g. can be called by os.path.join(): code:          
          Select a folder for later use, e.g. can be called by os.path.join()
Output:         
          Select a folder for later use, e.g. can be called by os.path.join()
          Select a folder for later use, e.g. can be called by os.path.join()         
You can then select a folder. When the "Select Folder" button is clicked without further selection, then the default folder will be used and the output will be:         
          Select a folder for later use, e.g. can be called by os.path.join()

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

Open a file: code:          
          Prevent other applications to modify the content until other Python script runs

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

Open a file: code:          
          Prevent other applications to modify the content until other Python script runs

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

Open a file: code:          
          Prevent other applications to modify the content until other Python script runs

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

Troubleshooting: Error occurs when running the script below (code):

          Move files from one directory to another (the file must already exist)
Error is:          
          File "C:/GlobalSino2/ICs/page4853movFiles5.py", line 16, in <module>
          os.rename(source, destination)
          FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Users\\yyliao\\Downloads\\AAPL.csv' -> 'C:\\0Python\\Stocks\\IndividualStocks\\AAPL.csv'
         
Correct script (code):          
          Move files from one directory to another (the file must already exist)




         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         

 

 

 

 

 

 

 

 

 

 

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