abc*_*483 6 python dialog file tkinter
我在用:
file = tkFileDialog.askopenfile(parent=root, mode='rb',
filetypes=[('Subrip Subtitle File','*.srt')], title='Choose a subtitle file')
Run Code Online (Sandbox Code Playgroud)
获取用户指定的文件对象.
有什么办法可以从文件对象中获取此文件的绝对路径吗?
Dan*_*enc 13
file = tkFileDialog.askopenfile(parent=root,mode='rb',filetypes=[('Subrip Subtitle File','*.srt')],title='Choose a subtitle file')
abs_path = os.path.abspath(file.name)
Run Code Online (Sandbox Code Playgroud)