logdiagnostic.py 文件源码

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

项目:BigBrotherBot-For-UrT43 作者: ptitbigorneau 项目源码 文件源码
def save_data_yaml(self, filename=None, *args):
        ''' Save or show the results in YAML '''
        if filename:
            self.stream = open(filename, 'w')
        else:
            self.stream = sys.stdout
        try:
            for game_log, stats in args:
                print >> self.stream, '### Stats per second of the log file %s:\n' % game_log
                print >> self.stream, '# Zero is significant (count missing lines): %s' % str(self.significantzero)
                print >> self.stream, yaml.dump(stats, default_flow_style=False, Dumper=Dumper)
                print >> self.stream, '---' # YAML objects separator
        except:
            print >> self.stream, yaml.dump_all(args, default_flow_style=False, Dumper=Dumper)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号