In the previous chapter, we visited some best practices that would help us in the long run when using Python. In this chapter, we're going to see how to make Python command-line programs and some features that make such programs easier and more useful. We're going to see how to create an entry point for code execution in a package and see how to run the package as a program.
We're also going to see how to make the program read data from its command line and how to easily handle reading data from our program's command-line arguments. We'll also look at how to actually run other programs from inside our code.
In this chapter, we will cover the following topics:
- Making a package executable via Python -m
- Handling command-line argument with argparse
- Python tools to interact with the user
- Executing other programs with subprocess...