相关资料https://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/0013868326118089581a091a04e4c30b2b7896392bdde5c000
from tkinter import *
import tkFileDialog
root = Tk()
def selefile():
filename = tkFileDialog.asksaveasfile()
print type(filename)
label = Label(root,text="")
label.pack()
select = Button(root,text="选择文件",command=selefile)
select.pack()
root.mainloop()
复制代码