我正在使用 fileopenbox() 并且我想在 Windows 框打开时选择我拥有的所有文本文件。我试过按 shift 或 ctrl + A,但没有用。
openfile = fileopenbox("Welcome", "COPR", filetypes= "*.txt")
Run Code Online (Sandbox Code Playgroud)
小智 5
如果在参数中包含multiple=True,则可以选择多个文件:
openfiles = fileopenbox("Welcome", "COPR", filetypes= "*.txt", multiple=True)
Run Code Online (Sandbox Code Playgroud)
请注意,现在 fileopenbox 将返回的不是字符串,而是字符串列表,例如:
["foo.txt", "Hello.txt", "mytxt.txt"]