1  How to write and test a Python program

Before you start working on the exercises, I want to discuss how to write programs that are documented and tested. Specifically, we’re going to

  • Write a Python program to say “Hello, World!”

  • Handle command-line arguments using argparse

  • Run tests for the code with Pytest.

  • Learn about $PATH

  • Use tools like YAPF and Black to format the code

  • Use tools like Flake8 and Pylint to find problems in the code

  • Use the new.py program to create new programs

1.1 Creating your first program

It’s pretty common to write “Hello, World!” as your first program in any language, so let’s start there. ...

Get Tiny Python Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.