What is Python?
|
Learning to use Python is like learning a new language. It takes practice.
Python code is text that a computer interprets as instructions. You can write it with a text editor and run it separately. Or, you can use an integrated tool like Jupyter to write and run it in the same environment.
Python can be used to find, move, survey, and transcode AV files.
|
Running and Quitting
|
Python scripts are plain text files.
Use the Jupyter Notebook for editing and running Python.
The Notebook has Command and Edit modes.
Use the keyboard and mouse to select and edit cells.
The Notebook will turn Markdown into pretty-printed documentation.
|
Transcoding One File
|
|
Generating a List of Files
|
Collecting filepaths is often the first step of any AV script
The import statement allows you to expand Python’s functionality by loading modules with specialized functions
Standard distribution modules are installed with Python. Other modules must be installed
Two common modules for listing files with Python are os and glob
The filepath is the sequence of parent folders that define the location of a particular file or directory
|
Moving and Transcoding Files
|
|
Lossless Compression and Codec Decisions
|
|
Finding Out About Files
|
|
Finding Out About AV Files
|
|
Checksums
|
|
Creating a Script
|
Once you’ve created code you want to use repeatedly, a script is more useful than a Jupyter Notebook
argparse is the Python module for accepting arguments from the command line
try and except blocks can be used to run code that may not work in every situation
|
Data Analysis and Visualization (Bonus)
|
Automate your CSV/Excel
Analyze data as you go
|