Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Python Command Line Arguments Tutorial for Beginners

Dave Gray via YouTube

Overview

Learn how to pass arguments to Python programs from the command line and utilize them within your code in this beginner-friendly tutorial video. Explore the argparse module, create practical examples, and apply command line arguments to personalize a Rock Paper Scissors game. Discover how to refactor code for customized output and gain hands-on experience with f-strings. Follow along as the instructor guides you through the process of implementing and playing the game with your newly acquired command line argument skills.

Syllabus

Intro
Welcome
Getting Started
argparse module
Example 1
Passing an argument at the command line
Example 2
Personalizing Rock Paper Scissors
Quick f-String update
Applying command line arguments to RPS
Refactoring to personalize output
Playing the game

Taught by

Dave Gray

Reviews

Start your review of Python Command Line Arguments Tutorial for Beginners

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.