spe2fitsGUI.py 文件源码

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

项目:spe2fits 作者: jerryjiahaha 项目源码 文件源码
def chooseDialogDir(self):
        self.chooseDirPath = filedialog.askdirectory(
                initialdir = self.chooseDirPath,
                parent = self,
                title = "Select Directory contains .SPE files",
                )
        print("select:", self.chooseDirPath)
        if len(self.chooseDirPath) == 0:
            return
        self.chooseDirOutDir = filedialog.askdirectory(
                initialdir = self.chooseDirPath,
                parent = self,
                title = "Select output Directory",
                mustexist = False,
                )
        # TODO check wirte permission first
        if not self.checkDir(self.chooseDirOutDir):
            return
        filenames = yieldFilesUnderDirectory(self.chooseDirPath,
                match = "*.SPE")
        if filenames is None:
            messagebox.showinfo("Convert result", "No .SPE files under this directory")
            return
        self.convertFiles(filenames, self.chooseDirOutDir,
                oldPrefix = self.chooseDirPath)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号