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
Page1_functions.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录