上QQ阅读APP看书,第一时间看更新
There's more…
This script can be further improved. We have provided a couple of recommendations here:
- Explore additional argparse functionality. For example, the argparse.FileType object can be used to accept a File object as an input.
- We can also use the argparse.ArgumentDefaultsHelpFormatter class to show defaults we set to the user. This is helpful when combined with optional arguments to show the user what will be used if nothing is specified.