使ってます:
file = tkFileDialog.askopenfile(parent=root, mode='rb',
filetypes=[('Subrip Subtitle File','*.srt')], title='Choose a subtitle file')
ユーザーが指定したファイルオブジェクトを取得します。
ファイルオブジェクトからこのファイルの絶対パスを取得する方法はありますか?
file = tkFileDialog.askopenfile(parent=root,mode='rb',filetypes=[('Subrip Subtitle File','*.srt')],title='Choose a subtitle file')
abs_path = os.path.abspath(file.name)
os.path.abspath私があなたの質問を正しく理解していれば、あなたが望むことをするべきです。