This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IDLE can be invoked from the command line with various options. The general syntax is:
-c command run command in the shell window
-d enable debugger and open shell window
-e open editor window
-h print help message with legal combinations and exit
-i open shell window
-r file run file in shell window
-s run $IDLESTARTUP or $PYTHONSTARTUP first, in shell window
-t title set title of shell window
- run stdin in shell (- must be last option before args)
.. code-block:: bash
If there are arguments:
python -m idlelib [options] [file ...]
* If ``-``, ``-c``, or ``r`` is used, all arguments are placed in
``sys.argv[1:...]`` and ``sys.argv[0]`` is set to ``''``, ``'-c'``,
or ``'-r'``. No editor window is opened, even if that is the default
set in the Options dialog.
The following options are available:
.. option:: -c <command>
Run the specified Python command in the shell window.
For example, pass ``-c "print('Hello, World!')"``.
On Windows, the outer quotes must be double quotes as shown.
.. option:: -d
Enable the debugger and open the shell window.
.. option:: -e
Open an editor window.
.. option:: -h
Print a help message with legal combinations of options and exit.
.. option:: -i
Open a shell window.
.. option:: -r <file>
Run the specified file in the shell window.
.. option:: -s
Run the startup file (as defined by the environment variables :envvar:`IDLESTARTUP` or :envvar:`PYTHONSTARTUP`) before opening the shell window.
.. option:: -t <title>
Set the title of the shell window.
.. option:: -
Read and execute standard input in the shell window. This option must be the last one before any arguments.
If arguments are provided:
- If ``-``, ``-c``, or ``-r`` is used, all arguments are placed in ``sys.argv[1:]``,
and ``sys.argv[0]`` is set to ``''``, ``'-c'``, or ``'-r'`` respectively.
No editor window is opened, even if that is the default set in the *Options* dialog.
- Otherwise, arguments are treated as files to be opened for editing, and ``sys.argv`` reflects the arguments passed to IDLE itself.
* Otherwise, arguments are files opened for editing and
``sys.argv`` reflects the arguments passed to IDLE itself.
Startup failure
^^^^^^^^^^^^^^^
Expand Down
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gh-130160: use .. program:: directive for documenting idle CLI #130278
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-130160: use .. program:: directive for documenting idle CLI #130278
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing