Write a Python script from scratch, add a shebang line so it runs directly from the terminal, and accept command-line arguments with sys.argv ā the three foundational patterns every DevOps Python tool is built on.
Create a directory for this lesson and activate the virtual environment from Lesson 101. Every lesson in this course reuses the same venv ā confirm it is active before writing any code.
mkdir -p ~/devops-python/lesson-102cd ~/devops-python/lesson-102source ~/devops-python/lesson-101/devops-env/bin/activateThe ~/devops-python/ parent holds all lesson directories in this course.
Activating the Lesson 101 venv gives access to pip and any packages installed there, including requests installed in Lesson 101.
Your terminal prompt shows (devops-env).
Running pwd prints .../lesson-102 and which python3 points inside devops-env/bin/.