I was wondering how I'd be able to have a python file run another file provided from user selection with Tkinter. This is what I have so far, file selection work but I am unable to actually run the chosen file.
import os
from tkinter import filedialog
from tkinter import *
root = Tk()
root.filename = filedialog.askopenfilename(initialdir = "/",title = "Select
file",filetypes = (("python","*.py"),("all files","*.*")))
print(root.filename)
a = root.filename
print(a.rfind('/'))
b = 'python '
c = (a[(a.rfind('/')+1):])
d = (b+c)
print(d)
os.system(d)