mirror of
https://github.com/python/cpython.git
synced 2025-11-08 09:32:01 +00:00
The default behaviour of idlefork idle is to open an editor window instead of a shell. Complex expressions may be run in a fresh environment by selecting "run". There are times, however, when a shell is desired. Though one can be started by "idle -t 'foo'", this script is more convenient. In addition, a shell and an editor window can be started in parallel by "idles -e foo.py".
13 lines
284 B
Python
Executable file
13 lines
284 B
Python
Executable file
#! /usr/bin/env python
|
|
|
|
import os
|
|
import sys
|
|
from idlelib import IdleConf
|
|
|
|
idle_dir = os.path.dirname(IdleConf.__file__)
|
|
IdleConf.load(idle_dir)
|
|
|
|
# defer importing Pyshell until IdleConf is loaded
|
|
from idlelib import PyShell
|
|
# open a shell instead of an editor window
|
|
PyShell.main(0)
|