starting Python IDLE from command line to edit scripts

Ponkadoodle picture Ponkadoodle · Feb 27, 2010 · Viewed 52.6k times · Source

I've tried many variations of this command: idle.py -e filepath, but it simply starts IDLE like normal, not opening any extra windows for editing, and not throwing any errors.

So how can I do the equivalent of opening IDLE, file>open>filepath via the command line (or perhaps even a Python module)?

Answer

llrs picture llrs · Jun 9, 2014

You need to do as stated in the main.py file of the idelib folder (C:\Python33\Lib\idlelib), at least on the python 3.3 version explains that:

IDLE main entry point

Run IDLE as python -m idlelib

So with python -m idlelib <script_to_edit> you will be able to open and edit the script with idle. I haven't checked with previous versions but it could be the same comand

This is also documented on the changelog of the version 3.3.3