CLI Program Execution
Table of contents
Description
You can easily execute your Python programs directly from the command line. First, navigate to the directory the .py
file is stored. Then, use the python3
command to execute the file.
addition.py
The following program prompts the user for two integers using the input()
function, then displays the sum. It is saved in the /Users/bianca/test
directory.
Navigate to directory and execute:
addition-cli.py
The following program accepts two integer arguments from the command line, then displays the sum. It is saved in the /Users/bianca/test
directory.