5 # see the install_IDLE target in python/dist/src/Mac/OSX/Makefile
9 # 1. Double clicking IDLE icon will open IDLE.
10 # 2. Dropping file on IDLE icon will open that file in IDLE.
11 # 3. Launch from command line with files with this command-line:
13 # /Applications/Python/IDLE.app/Contents/MacOS/python file1 file2 file3
17 # Add IDLE.app/Contents/Resources/idlelib to path.
18 # __file__ refers to this file when it is used as a module, sys.argv[0]
19 # refers to this file when it is used as a script (pythonw macosx_main.py)
22 from os
.path
import split
, join
, isdir
26 __file__
= sys
.argv
[0]
27 idlelib
= join(split(__file__
)[0], 'idlelib')
29 sys
.path
.append(idlelib
)
31 # see if we are being asked to execute the subprocess code
33 # run expects only the port number in sys.argv
36 # this module will become the namespace used by the interactive
37 # interpreter; remove all variables we have defined.
38 del sys
, __file__
, split
, join
, isdir
, idlelib
39 __import__('run').main()
41 # Load idlelib/idle.py which starts the application.