pyUVVIS.py 文件源码

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

项目:pyUVVIS 作者: ddietze 项目源码 文件源码
def OnTBLoad(self, event):
        if self.running:
            rng = True
            self.OnTBStart()
        else:
            rng = False

        dlg = wx.FileDialog(None, "Open Spectrum", os.getcwd(), "", "*.*", wx.OPEN)
        if dlg.ShowModal() == wx.ID_OK:
            filename = dlg.GetPath()
            # set new working directory
            directory = os.path.split(filename)
            if not os.path.isdir(filename):
                os.chdir(directory[0])
            # save file
            tmpx, tmpy = np.loadtxt(filename, unpack=True)
            # add to plot window
            self.addLine(tmpx, tmpy)

        dlg.Destroy()

        if rng:
            self.OnTBStart()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号