我正在尝试使用 Tkinter 获取目录的完整路径,但只显示目录名称。
例如,当我选择“C:\Python27\Doc”时,不会显示完整路径,而只显示“Doc”。
class Actions:
def openfile(self): #open the file
directory = tkFileDialog.askdirectory()
print(directory)
def body(self):
Label (text='Please select a directory').pack(side=TOP,padx=10,pady=10)
我找到了这个http://tkinter.unpythonic.net/wiki/tkFileDialog,但除非我误解它,否则我看不到任何完整路径。