postcards.py 文件源码

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

项目:postcards 作者: abertschi 项目源码 文件源码
def do_command_generate(self, args):
        target_location = str(os.path.join(os.getcwd(), 'config.json'))

        if os.path.isfile(target_location):
            self.logger.error('config file already exist in current directory.')
            exit(1)

        content = pkg_resources.resource_string(__name__, 'template_config.json').decode('utf-8')
        file = open(target_location, 'w')
        file.write(content)
        file.close()

        self.logger.info('empty config file generated at {}'.format(target_location))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号