Articles → PYTHON → Command line arguments in python

Command line arguments in python






What are command line arguments?






python gyan.py "A", "B"





Accessing command line arguments in code





Example




import sys

if len(sys.argv) > 0:
   print(sys.argv)




Picture showing the output of command line arguments in python

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Sunday, September 12, 2021

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250