Page1_functions.py 文件源码

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

项目:pyry3d_chimera_extension 作者: mdobrychlop 项目源码 文件源码
def choosestruct(self, initialdir):
        p = Tkinter.Tk()
        p.withdraw()
        slist = []
        structures = tkFileDialog.askopenfilenames(
                        parent=p, initialdir=initialdir,
                        title="Choose structure files",
                        filetypes=[("pdb files", ".pdb")]
                        )

        # WARNING! askopenfilenames:
        # on Windows, it returns a string. On Linux, it returns a list.

        if type(structures) is list or type(structures) is tuple:  # if on Linux
            for i in structures:
                slist.append(i)
        elif len(structures) > 1:  # if on Windows and anything was chosen
            structures = structures.split(" ")
            for i in structures:
                slist.append(i)
        else:  # if "cancel"
            pass
        return slist
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号