gantt.py 文件源码

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

项目:Python-Gantt 作者: asisrai23 项目源码 文件源码
def save(self, width='100%', height='100%'):
        """ Write the XML string to **filename**. """
        test = False
        import io

        # Fix height and width
        self['height'] = height
        self['width'] = width

        if sys.version_info[0] == 2:
            test = type(self.filename) == types.FileType or type(self.filename) == types.InstanceType
        elif sys.version_info[0] == 3:
            test = type(self.filename) == io.TextIOWrapper

        if test:
            self.write(self.filename)
        else:
            fileobj = io.open(str(self.filename), mode='w', encoding='utf-8')
            self.write(fileobj)
            fileobj.close()



############################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号