Ronald Oussoren | 836b039 | 2006-05-14 19:56:34 +0000 | [diff] [blame] | 1 | import argvemulator |
| 2 | from idlelib.PyShell import main |
| 3 | import sys, os |
| 4 | |
Tim Peters | cbd7b75 | 2006-05-16 23:22:20 +0000 | [diff] [blame] | 5 | # Make sure sys.executable points to the python interpreter inside the |
Ronald Oussoren | 836b039 | 2006-05-14 19:56:34 +0000 | [diff] [blame] | 6 | # framework, instead of at the helper executable inside the application |
| 7 | # bundle (the latter works, but doesn't allow access to the window server) |
| 8 | sys.executable = os.path.join(sys.prefix, 'bin', 'python') |
| 9 | |
| 10 | # Look for the -psn argument that the launcher adds and remove it, it will |
| 11 | # only confuse the IDLE startup code. |
| 12 | for idx, value in enumerate(sys.argv): |
| 13 | if value.startswith('-psn_'): |
| 14 | del sys.argv[idx] |
| 15 | break |
| 16 | |
| 17 | argvemulator.ArgvCollector().mainloop() |
| 18 | if __name__ == '__main__': |
Tim Peters | cbd7b75 | 2006-05-16 23:22:20 +0000 | [diff] [blame] | 19 | main() |