Command line applications in Python using Argparse
- Understanding positional arguments
ping google.com
cp 1.txt 2.txt
- Introduction optional arguments
ping -c 4 google.com
cp -r src/ test/
-
Refer Here for the basic example
-
Exercise: Create a python program to accept prinicipal amount, rate of intrest and time period in years and display the simple and compount intrest to the user
interestcalculator.py -p 10000 -r 10 -t 3
- Refer Here for the changeset
- Refer Here for the official docs of argparse