Datasets:

Modalities:
Text
Formats:
text
Tags:
code
Libraries:
Datasets
License:
index1 / 1_command_line_and_environment_python_3717_documentation_1.txt
blaze-aura69's picture
Upload 1_command_line_and_environment_python_3717_documentation_1.txt with huggingface_hub
ef8187a verified
================================================================================DOMAIN_URL: docs.python.org
PAGE_URL: https://docs.python.org/3.7/using/cmdline.html
TITLE: 1. Command line and environment — Python 3.7.17 documentation
CRAWLED: 2026-06-07T21:58:45Z
CATEGORY: technology
RELEVANCE_SCORE: 88.00
WORD_COUNT: 4132
KEYWORDS: python, script, directory, file, name, given, module, option, ofsys, version, called, path, hash, executes, code
IMAGES (2):
- URL: https://docs.python.org/3.7/_static/py.png
- URL: https://docs.python.org/3.7/_static/py.png
INTERNAL_LINKS (50):
- https://docs.python.org/3/using/cmdline.html
- https://docs.python.org/3.7/genindex.html
- https://docs.python.org/3.7/py-modindex.html
- https://docs.python.org/3.7/using/unix.html
- https://docs.python.org/3.7/using/index.html
- https://python.org/
- https://docs.python.org/3.7/index.html
- https://docs.python.org/3.7/using/index.html
- https://docs.python.org/3.7/reference/introduction.html
- https://docs.python.org/3.7/library/sys.html
- https://docs.python.org/3.7/library/sys.html
- https://docs.python.org/3.7/library/sys.html
- https://docs.python.org/3.7/library/sys.html
- https://docs.python.org/3.7/library/__main__.html
- https://docs.python.org/3.7/library/sys.html
- https://docs.python.org/3.7/library/sys.html
- https://docs.python.org/3.7/library/sys.html
- https://docs.python.org/3.7/library/timeit.html
- https://docs.python.org/3.7/library/runpy.html
- https://python.org/dev/peps/pep-0338
EXTERNAL_LINKS (4):
- http://ocert.org/advisories/ocert-2011-003.html
- http://jython.org/
- https://github.com/python/cpython/blob/3.7/Doc/using/cmdline.rst
- http://sphinx.pocoo.org/
METADATA:
- generator: Docutils 0.17.1: http://docutils.sourceforge.net/
CONTENT:
EnglishSpanish | españolFrench | françaisItalian | italianoJapanese | 日本語Korean | 한국어Polish | polskiBrazilian Portuguese | Português brasileiroTurkish | TürkçeSimplified Chinese | 简体中文Traditional Chinese | 繁體中文dev (3.14)3.133.123.113.103.93.83.7.173.63.53.43.33.23.13.02.72.6
1.Command line and environment¶
The CPython interpreter scans the command line and the environment for various
settings.
CPython implementation detail:Other implementations’ command line schemes may differ. SeeAlternate Implementationsfor further resources.
When invoking Python, you may specify any of these options:
The most common use case is, of course, a simple invocation of a script:
The interpreter interface resembles that of the UNIX shell, but provides some
additional methods of invocation:
When called with standard input connected to a tty device, it prompts for
commands and executes them until an EOF (an end-of-file character, you can
produce that withCtrl-Don UNIX orCtrl-Z, Enteron Windows) is read.
When called with standard input connected to a tty device, it prompts for
commands and executes them until an EOF (an end-of-file character, you can
produce that withCtrl-Don UNIX orCtrl-Z, Enteron Windows) is read.
When called with a file name argument or with a file as standard input, it
reads and executes a script from that file.
When called with a file name argument or with a file as standard input, it
reads and executes a script from that file.
When called with a directory name argument, it reads and executes an
appropriately named script from that directory.
When called with a directory name argument, it reads and executes an
appropriately named script from that directory.
When called with-ccommand, it executes the Python statement(s) given ascommand. Herecommandmay contain multiple statements separated by
newlines. Leading whitespace is significant in Python statements!
When called with-ccommand, it executes the Python statement(s) given ascommand. Herecommandmay contain multiple statements separated by
newlines. Leading whitespace is significant in Python statements!
When called with-mmodule-name, the given module is located on the
Python module path and executed as a script.
When called with-mmodule-name, the given module is located on the
Python module path and executed as a script.
In non-interactive mode, the entire input is parsed before it is executed.
An interface option terminates the list of options consumed by the interpreter,
all consecutive arguments will end up insys.argv– note that the first
element, subscript zero (sys.argv[0]), is a string reflecting the program’s
source.
Execute the Python code incommand.commandcan be one or more
statements separated by newlines, with significant leading whitespace as in
normal module code.
If this option is given, the first element ofsys.argvwill be"-c"and the current directory will be added to the start ofsys.path(allowing modules in that directory to be imported as top
level modules).
S
================================================================================