2024-09-30 22:18:24 发布
网友
我想知道是否有类似于Java针对Python的JFileChooser?在
JFileChooser
JFileChooser是选择文件的图形前端。在
最好是Python中已有的东西。也许和特金特一起。在
对于不需要wxPython并坚持使用标准Python库的东西,可以使用tkFileDialog.askopenfilename()方法:
#!/usr/bin/python from Tkinter import * from tkFileDialog import askopenfilename root = Tk() root.withdraw() print askopenfilename()
wxPython公司(www.wxpython.org)提供wx.FileDialog类,它将在任何受支持的平台(Mac、Linux或Windows)上为您提供本机文件选择对话框。在
最简单的方法是(使用PyGTK和Kiwi):
from kiwi.ui.dialogs import open as open_dialog chosen_path = open_dialog('Select a file', folder='/start/folder') if chosen_path is not None: # do something ...
对于不需要wxPython并坚持使用标准Python库的东西,可以使用tkFileDialog.askopenfilename()方法:
wxPython公司(www.wxpython.org)提供wx.FileDialog类,它将在任何受支持的平台(Mac、Linux或Windows)上为您提供本机文件选择对话框。在
最简单的方法是(使用PyGTK和Kiwi):
相关问题 更多 >
编程相关推荐