tkdialogs.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:docximport-sigil-plugin 作者: dougmassay 项目源码 文件源码
def fileChooser(self, ftype, tkentry, tkcheck=None, tkbutton=None):
        file_opt = FTYPE_MAP[ftype]
        file_opt['parent'] = None
        file_opt['initialdir'] = self.prefs['lastDir'][ftype]
        file_opt['multiple'] = False
        inpath = askopenfilename(**file_opt)
        if len(inpath):
            tkentry.config(state="normal")
            tkentry.delete(0, tkinter.constants.END)
            tkentry.insert(0, os.path.normpath(inpath))
            self.prefs['lastDir'][ftype] = os.path.dirname(inpath)
            tkentry.config(state="readonly")
        else:
            if tkcheck is not None:
                tkcheck.deselect()
            if tkbutton is not None:
                tkbutton.config(state='disabled')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号