output.py 文件源码

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

项目:rtf2xml 作者: paulhtremblay 项目源码 文件源码
def __output_xml(self, in_file, out_file):
        """

        output the ill-formed xml file

        """

        (utf8_encode, utf8_decode, utf8_reader, utf8_writer) = codecs.lookup("utf-8")
        write_obj = utf8_writer(open(out_file, 'w'))
        write_obj = open(out_file, 'w')
        read_obj = utf8_writer(open(in_file, 'r'))
        read_obj = open(in_file, 'r')
        line = 1
        while line:
            line = read_obj.readline()
            if isinstance(line, type(u"")):
                line = line.encode("utf-8")
            write_obj.write(line)

        read_obj.close()
        write_obj.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号