答案 0 :(得分:1)
以下是http://www.daniweb.com/forums/thread39327.html的示例:
import tkFileDialog
def open_it():
filename = tkFileDialog.askopenfilename()
print filename # test
def save_it():
filename = tkFileDialog.askopenfilename()
print filename # test
def save_as():
filename = tkFileDialog.asksaveasfilename()
print filename # test