from tkinter import Tk
from tkinter.ttk import Button
import os
root = Tk() # Creating the main window
root.title("Whatever you want")
root.geometry("300x200")
def open_files(): # function to run the apps/programs/files
os.startfile("file1.py")
os.startfile("file2.py")
open_b = Button(root, text="Open files", command=open_files) # Creating the button
open_b.pack(pady=20)
root.mainloop()
替换项目文件的路径:
1.2:
2.2:
我相信你需要按一个按钮同时运行两个程序,对吗
创建两个单独的程序。 最后的代码是:
相关问题 更多 >
编程相关推荐