How To Use subprocess to Run External Programs in Python 3
Python 3’s subprocess module can be used to run external programs and read their outputs in your Python code. subprocess includes several classes and functions, but in this tutorial we’ll cover one of subprocess’s most useful functions: subprocess.run. We’ll review its different uses and main keyword arguments.