The class will introduce students to Python flow control tools such as if-else statements, match-case statements, iterables, advanced functions and more ways to divert the flow of your program.
For this class we will need to install some third-party libraries, namely pydub, which requires us to use virtual environments — picture them as a box in which your programs and libraries that support them reside.
They are completely isolated from other virtual environments and you will have to create them and install required packages for every new project you do. But they make for a good isolated container that only has tools essential for the job.
-
Download ffmpeg and unarchive it
-
Go to the unarchived folder, locate
bin
folder and copy its path -
Open search (
Win+S
) and search forEdit the system environmental variables
-
Navigate to
Environment variables...
->System variables
->Path
and double-click it -
Paste the copied path into an empty field and click "ok"
-
Test the installation by typing
ffmpeg
to your terminal
-
Create a folder whereever you'd like and open your terminal (or code editor with terminal) there
-
Create a virtual environment in the current directory (
.
):py -m venv .
-
Activate it:
.\Scripts\activate
if your next prompt starts with
(python)
or(<current-directory-name>)
then you have successfully activated your virtual environment and can now work on your code. But first we need to install some packages -
Install pydub, pyaudio and scipy:
pip install pydub pyaudio scipy
-
Install HomeBrew — a convinient package manager for Mac OS and Linux:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
-
Add it to your PATH:
echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.bash_profile && source ~/.bash_profile
-
Install ffmpeg and PortAudio:
brew install ffmpeg portaudio
-
Create a folder whereever you'd like and open your terminal (or code editor with terminal) there
-
Create a virtual environment in the current directory (
.
):python3 -m venv .
-
Activate it:
source ./bin/activate
if your next prompt starts with
(python)
or(<current-directory-name>)
then you have successfully activated your virtual environment and can now work on your code. But first we need to install some packages -
Install pydub and pyaudio:
pip install pydub pyaudio
-
Use your package manager to install ffmpeg. For example on Ubuntu/Debian/Mint:
sudo apt update && sudo apt install ffmpeg
-
Test the installation by typing
ffmpeg
to your terminal
-
Create a folder whereever you'd like and open your terminal (or code editor with terminal) there
-
Create a virtual environment in the current directory (
.
):python -m venv .
-
Activate it:
source ./bin/activate
if your next prompt starts with
(python)
or(<current-directory-name>)
then you have successfully activated your virtual environment and can now work on your code. But first we need to install some packages -
Install pydub:
pip install pydub