Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 91e476f

Browse files
committed
Add a script "idles" which opens a Python Shell window.
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".
1 parent fe2127d commit 91e476f

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Lib/idlelib/idles

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#! /usr/bin/env python
2+
3+
import os
4+
import sys
5+
from idlelib import IdleConf
6+
7+
idle_dir = os.path.dirname(IdleConf.__file__)
8+
IdleConf.load(idle_dir)
9+
10+
# defer importing Pyshell until IdleConf is loaded
11+
from idlelib import PyShell
12+
# open a shell instead of an editor window
13+
PyShell.main(0)

0 commit comments

Comments
 (0)