Search code examples
pythonpython-idle

IDLE call project


Is there a way of running a project through IDLE from another script. The code below opens the project File.py in the idle interface to be edited. Is there a way of doing this running the program in doing so.

import os
os.system (path + '\\idlelib\\idle.bat File.py')

This code opens a python shell but doesn't take an argument to run my project.

import idlelib.pyshell
idlelib.pyshell.main ()

Simply, an idle shell window should open running my File.py project.

Thanks in advance.


Solution

  • You can add a -r parameter (before the script name) when launching IDLE via your os.system() call.