home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 14 / hacker14.iso / programacao / pythonwin / python.exe / IDLE.PY < prev    next >
Encoding:
Python Source  |  2003-05-24  |  706 b   |  24 lines

  1. #!/usr/bin/python
  2.  
  3. try:
  4.     import idlelib.PyShell
  5. except ImportError:
  6.     # IDLE is not installed, but maybe PyShell is on sys.path:
  7.     try:
  8.         import PyShell
  9.     except ImportError:
  10.         raise
  11.     else:
  12.         import os
  13.         idledir = os.path.dirname(os.path.abspath(PyShell.__file__))
  14.         if idledir != os.getcwd():
  15.             # We're not in the IDLE directory, help the subprocess find run.py
  16.             pypath = os.environ.get('PYTHONPATH', '')
  17.             if pypath:
  18.                 os.environ['PYTHONPATH'] = pypath + ':' + idledir
  19.             else:
  20.                 os.environ['PYTHONPATH'] = idledir
  21.         PyShell.main()
  22. else:
  23.     idlelib.PyShell.main()
  24.