There are three different ways to start Python −
You can start Python from Unix, DOS, or any other system that provides you a command-line interpreter or shell window.
Enter python the command line.
Start coding right away in the interactive interpreter.
$python # Unix/Linux or python% # Unix/Linux or C:> python # Windows/DOS
Here is the list of all the available command line options −
|Sr.No.||Option & Description|
It provides debug output.
It generates optimized bytecode (resulting in .pyo files).
Do not run import site to look for Python paths on startup.
verbose output (detailed trace on import statements).
disable class-based built-in exceptions (just use strings); obsolete starting with version 1.6.
run Python script sent in as cmd string
run Python script from given file
Script from the Command-line
A Python script can be executed at command line by invoking the interpreter on your application, as in the following −
$python script.py # Unix/Linux or python% script.py # Unix/Linux or C: >python script.py # Windows/DOS
Note − Be sure the file permission mode allows execution.
You can run Python from a Graphical User Interface (GUI) environment as well, if you have a GUI application on your system that supports Python.
If you are not able to set up the environment properly, then you can take help from your system admin. Make sure the Python environment is properly set up and working perfectly fine.