Skip main navigation

Introduction to `argparse`

Learn about the Python module, named `argparse`, the recommended command-line parsing module in the Python standard library.

In this video, you will begin to learn about the Python module, named argparse.

argparse provides more functionality, and although it requires a bit more work, it is the preferred method to parse command-line arguments.

This video tutorial is an introduction to argparse, the recommended command-line parsing module in the Python standard library.

Follow along

The file used in this video is python_argparse_ex1.py and is available for download from the Downloads section below. Once you have downloaded the file, open the file in VS Code, and follow along with the video.

Join the discussion

This is the args starting point. Share with your peers why you believe this is part of the Python standard library?
Use the Comments section below and let us know your thoughts. Try to respond to at least one other post and once you are happy with your contribution, click the Mark as complete button to check the step off, then you can move to the next step.

In the next step, we will learn how to add the first position argument to the parser object.

This article is from the free online

Intermediate Python

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now