Overview
Google, IBM & Meta Certificates — All 10,000+ Courses at 40% Off
One annual plan covers every course and certificate on Coursera. 40% off for a limited time.
Get Full Access
Learn how to execute Python programs using command line arguments in this 20-minute tutorial. Discover how to provide inputs to your program as arguments at the command prompt, eliminating the need for input functions within the code. Explore the argv list, which stores command line arguments, and learn to process it by importing the sys module. Understand how to access argv elements using indexing, with the filename always stored at index 0 and subsequent arguments starting from index 1. Master the syntax for executing programs with command line arguments in the command prompt using the format "py filename.py arg1 arg2 arg3...".
Syllabus
COMMAND LINE ARGUMENTS - PYTHON PROGRAMMING
Taught by
Sundeep Saradhi Kanthety