def write_file(path, content, append=False):
    """写入文件"""
    if isinstance(content, six.text_type):
        content = content.encode('utf-8')
    with open(path, 'ab' if append else 'wb') as f:
        return f.write(content)
写入文件
jqdatasdk/api.py