def diropenbox(msg=None
, title=None
, default=None
):
"""
A dialog to get a directory name.
Note that the msg argument, if specified, is ignored.
Returns the name of a directory, or None if user chose to cancel.
If the "default" argument specifies a directory name, and that
directory exists, then the dialog box will start with that directory.
"""
title=getFileDialogTitle(msg,title)
boxRoot = Tk()
boxRoot.withdraw()
if not default: default = None
f = tk_FileDialog.askdirectory(
parent=boxRoot
, title=title
, initialdir=default
, initialfile=None
)
boxRoot.destroy()
if not f: return None
return os.path.normpath(f)
#-------------------------------------------------------------------
# getFileDialogTitle
#-------------------------------------------------------------------
评论列表
文章目录