0001 try: 0002 import idlelib.PyShell 0003 except ImportError: 0004 # IDLE is not installed, but maybe PyShell is on sys.path: 0005 try: 0006 import PyShell 0007 except ImportError: 0008 raise 0009 else: 0010 import os 0011 idledir = os.path.dirname(os.path.abspath(PyShell.__file__)) 0012 if idledir != os.getcwd(): 0013 # We're not in the IDLE directory, help the subprocess find run.py 0014 pypath = os.environ.get('PYTHONPATH', '') 0015 if pypath: 0016 os.environ['PYTHONPATH'] = pypath + ':' + idledir 0017 else: 0018 os.environ['PYTHONPATH'] = idledir 0019 PyShell.main() 0020 else: 0021 idlelib.PyShell.main() 0022
Generated by PyXR 0.9.4