openmedialibrary_platform_d.../lib/python3.7/idlelib/idle.pyw

18 lines
570 B
Python
Raw Normal View History

2016-02-06 15:06:57 +05:30
try:
2019-01-01 00:25:26 +01:00
import idlelib.pyshell
2016-02-06 15:06:57 +05:30
except ImportError:
2019-01-01 00:25:26 +01:00
# IDLE is not installed, but maybe pyshell is on sys.path:
from . import pyshell
2016-02-06 15:06:57 +05:30
import os
2019-01-01 00:25:26 +01:00
idledir = os.path.dirname(os.path.abspath(pyshell.__file__))
2016-02-06 15:06:57 +05:30
if idledir != os.getcwd():
# We're not in the IDLE directory, help the subprocess find run.py
pypath = os.environ.get('PYTHONPATH', '')
if pypath:
os.environ['PYTHONPATH'] = pypath + ':' + idledir
else:
os.environ['PYTHONPATH'] = idledir
2019-01-01 00:25:26 +01:00
pyshell.main()
2016-02-06 15:06:57 +05:30
else:
2019-01-01 00:25:26 +01:00
idlelib.pyshell.main()