__init__.py 文件源码

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

项目:Projects 作者: it2school 项目源码 文件源码
def warn(self):
        if self.urgent:
            type = 'import'
        else:
            type = 'use'
        message = '%s %s: %s' % (type, self.name, self.info)
        if self.reason:
            message += "\n(%s)" % self.reason
        try:
            import warnings
            if self.urgent:
                level = 4
            else:
                level = 3
            warnings.warn(message, RuntimeWarning, level)
        except ImportError:
            print (message)


# we need to import like this, each at a time. the cleanest way to import
# our modules is with the import command (not the __import__ function)

# first, the "required" modules
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号