CHAPTER TEN BRIEF TOUR OF THE STANDARD LIBRARY 10.1 Operating System Interface 10.2 File Wildcards The$_{os}$ module provides dozens of functions for interacting with the operating system: Be sure to use the$_{import os}$ style instead of$_{from os import *}$ . This will keep$_{os.open()}$ from shad- owing the built-in$_{open()}$ function which operates much differently. The built-in$_{dir()}$ and$_{help()}$ functions are useful as interactive aids for working with large modules like$_{os}$: For daily file and directory management tasks, the$_{shutil}$ module provides a higher level interface that is easier to use: The$_{glob}$module provides a function for making file lists from directory wildcard searches: 79 >>> import os >>> os.getcwd() # Return the current working directory 'C:\\Python39' >>> os.chdir('/server/accesslogs ') # Change current working directory >>> os.system('mkdir today') # Run the command mkdir in the system shell 0 >>> import os >>> dir (os) <returns a list of all module functions> >>> help(os) <returns an extensive manual page created from the module's docstrings> >>> import shutil >>> shutil.copyfile( 'data.db ','archive.db') 'archive.db' >>> shutil.move( '/build/executables ','installdir') 'installdir' >>> import glob >>> glob.glob( '*.py ') ['primes.py', 'random.py', 'quote.py']