
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Command Line Arguments in Python
Many programs can be run to provide you with some basic information about how they should be run. Python enables you to do this with -h −
$ python -h usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ... Options and arguments (and corresponding environment variables): -c cmd : program passed in as string (terminates option list) -d : debug output from parser (also PYTHONDEBUG=x) -E : ignore environment variables (such as PYTHONPATH) -h : print this help message and exit [ etc. ]
You can also program your script in such a way that it should accept various options. Command Line Arguments is an advanced topic and should be studied a bit later once you have gone through rest of the Python concepts.
- Related Questions & Answers
- Java command line arguments
- Command Line and Variable Arguments in Python?
- Command line arguments in Java
- Command Line arguments in C#
- Command Line arguments in Lua
- Explain Java command line arguments.
- How to add command line arguments in Python?
- Command Line arguments in Java programming
- Command line arguments in C/C++
- Command line arguments example in C
- How do we access command line arguments in Python?
- How to Parse Command Line Arguments in C++?
- getopt() function in C to parse command line arguments
- How command line arguments are passed in main method in C#?
- Command Line Interface Programming in Python?
Advertisements