blob: 2a61720b40f930e008a7a9f9c345bd00b4a33d8c [file] [log] [blame]
Kurt B. Kaiserf4f42762002-12-24 06:36:19 +00001try:
2 import idlelib.PyShell
Kurt B. Kaiser7cca3d82002-12-31 23:18:00 +00003except ImportError:
Kurt B. Kaiserf4f42762002-12-24 06:36:19 +00004 # IDLE is not installed, but maybe PyShell is on sys.path:
Kurt B. Kaisera80d57c2003-05-17 03:15:48 +00005 try:
6 import PyShell
7 except ImportError:
8 print "Can't locate PyShell.py"
9 else:
10 import os
11 idledir = os.path.dirname(os.path.abspath(PyShell.__file__))
12 if idledir != os.getcwd():
13 # We're not in the IDLE directory, help the subprocess find run.py
14 pypath = os.environ.get('PYTHONPATH', '')
15 os.environ['PYTHONPATH'] = pypath + ':' + idledir
16 PyShell.main()
Kurt B. Kaisere23ca3c2003-01-02 17:09:34 +000017else:
18 idlelib.PyShell.main()