Last active
October 18, 2020 14:00
-
-
Save cogas/c89918d0c3f085d2116b to your computer and use it in GitHub Desktop.
tkinter使ってダイアログからファイル名を取得できる
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fileopen (): | |
import tkinter | |
import tkinter.filedialog | |
tk = tkinter.Tk() | |
tk.withdraw() | |
args = {"initialdir" : "c:", "filetypes" : [("テキストファイル", "*.txt")], "title": "ファイル選択"} | |
name = tkinter.filedialog.askopenfilename(**args) | |
return name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment