So I've been finding a few answers but none of them do the trick. I'd like to open a file (script.py) in IDLE using a python script (openscript.py). It seems os.system or subprocess.Popen should do the trick but I can't seem to find the correct link to open in IDLE.
import os
def openFile():
filename = "script.py"
os.system("C:\\Program Files\\Python38\\Lib\\idlelib\\idle.pyw " + filename)
openFile()
C:\Users\xyz\AppData\Local\Programs\Python\Python38\Lib\idlelib>idle.bat C:\Users\xyz\py\filename.pyr' ... 'so you don't have to escape all those backslashes