home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 June / maximum-cd-2009-06.iso / DiscContents / OOo_3.0.1_Win32Intel_install_wJRE_en-US.exe / openofficeorg1.cab / idle.py < prev    next >
Encoding:
Python Source  |  2008-12-15  |  683 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.