For this lab, let’s use VSCode on Kali. (Not sure how to install it. Click Here)

Passing in command line arguments to a Python program is something you’ll commonly see and find helpful to include in your programs. Up to this point, we’ve been creating Python programs and running them like this:

python3 myprogram.py

Command line arguments are extra parameters that can be passed into a program at run time. It might look like this if we passed two command line arguments to the hypothetical program above.

Untitled

In this lab, we’ll create a program that allows the end user to pass in values to a program. Create a folder called Lab08, and let’s call the program lab09.py. We’ll start by writing a program designed to analyze the parameters passed in by the end user.

Untitled

Run the program like this, and you’ll see that it prints back the user-supplied arguments.

Untitled

Just for demonstration purposes, modify/simplify the program so it now looks like this:

Untitled

Now run it and consider the output:

Untitled

Here’s the concept:

Checkpoint/Challenge:

Example Output: