Class 19
Back to home page
Automation
Q. How can you use regular expressions in Python to search for specific patterns in a string, and what is the primary library to work with them?
- re is the primary library to use when searching for regular expressions, this import will allow you to use regex expressions in python to search for patterns and validate them.
Q. What is the purpose of the shutil library in Python, and provide an example of a common use case for file or directory management with this library?
- shutil is a library thats used to do high level operations on files. For example, copying a files metadata from one file to another.
Q. Explain one automation idea from the assigned material and describe how it can be implemented using Python’s regular expressions and shutil libraries.
- For autimatically renaming and moving files, we could re to sweep through the files to match with a certain type of folder by their name or contents, and use shutil to move the files too their new folders.
Bookmark and review
Things I want to know more about
How much software is automated for a company like google? Is it effecient to have everything automated or more risky?