argschema_parser.py 文件源码

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

项目:argschema 作者: AllenInstitute 项目源码 文件源码
def output(self,d,output_path=None):
        """method for outputing dictionary to the output_json file path after
        validating it through the output_schema_type

        Parameters
        ----------
        d:dict
            output dictionary to output 
        output_path: str
            path to save to output file, optional (with default to self.mod['output_json'] location)
        Raises
        ------
        marshmallow.ValidationError
            If any of the output dictionary doesn't meet the output schema
        """
        if output_path is None:
            output_path = self.args['output_json']

        output_json = self.get_output_json(d)
        with open(output_path,'w') as fp:
            json.dump(output_json,fp)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号