extended_pyGISS.py 文件源码

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

项目:pyGISS 作者: afourmy 项目源码 文件源码
def import_nodes(self):
        filepath = filedialog.askopenfilenames(filetypes = (('xls files','*.xls'),))
        if not filepath:
            return
        else:
            filepath ,= filepath
        book = xlrd.open_workbook(filepath)
        try:
            sheet = book.sheet_by_index(0)
        # if the sheet cannot be found, there's nothing to import
        except xlrd.biffh.XLRDError:
            warnings.warn('the excel file is empty: import failed')
        for row_index in range(1, sheet.nrows):
            x, y = self.to_canvas_coordinates(*sheet.row_values(row_index))
            self.create_object(x, y)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号