recipe-577638.py 文件源码

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

项目:code 作者: ActiveState 项目源码 文件源码
def create_path(self, path, name):
        # If the user is running Windows ...
        if hasattr(os, 'startfile'):
            # Create a new tag for the path.
            self.__path_id += 1
            tag = 'path' + str(self.__path_id)
            # Add the text and create an opening command.
            self.__text.insert(tkinter.END, name, ('dynamic_link', tag))
            self.__text.tag_bind(tag, '<1>', lambda event: os.startfile(path))
        else:
            # Insert a link that does not do anything.
            self.__text.insert(tkinter.END, name, 'static_link')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号