e-learning

Python - Argparse

Abstract

argparse is an argument parsing library for Python that's part of the stdlib. It lets you make command line tools significantly nicer to work with.

About This Material

This is a Hands-on Tutorial from the GTN which is usable either for individual self-study, or as a teaching material in a classroom.

Questions this will address

  • How do I make a proper command line script
  • How do I use argparse?
  • What problems does it solve?

Learning Objectives

  • Learn how sys.argv works
  • Write a simple command line program that sums some numbers
  • Use argparse to make it nicer.

Licence: Creative Commons Attribution 4.0 International

Keywords: Foundations of Data Science

Target audience: Students

Resource type: e-learning

Version: 5

Status: Active

Learning objectives:

  • Learn how sys.argv works
  • Write a simple command line program that sums some numbers
  • Use argparse to make it nicer.

Date modified: 2023-01-24

Date published: 2022-04-25

Authors: Helena Rasche

Contributors: Bazante Sanders, Beatriz Serrano-Solano, Donny Vrins, Helena Rasche, Marius van den Beek, Peter van Heusden, Saskia Hiltemann

Scientific topics: Software engineering

External resources:

Activity log