Scripting with Python
Laura Cassell, Alan Gauld · 2014
Scripting means coordinating the actions of other programs or applications to perform a task such as bulk file printing or an automated workfl ow, such as adding a new user. This chapter teaches how to use Python modules to check user settings as well as directory and file access levels; set up the correct environment for an operation; and launch and control external programs from your script. It shows how to access and manage computer resources via the operating system. The chapter discusses the handling of common file formats such as CSV and XML, and working with dates and times. It shows how to automate applications and access their APIs, and use third-party modules to extend automation beyond the standard library capabilities. Information on how to directly access the low-level programming interfaces of external applications using the very powerful ctypes module and, for Windows, the pywin32 package, is also provided.