Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

对于Windows系统需要在读取文件时加encoding='utf-8' #13

Open
mayanbo1994 opened this issue Jun 6, 2018 · 0 comments
Open

Comments

@mayanbo1994
Copy link

def save_data(frined_list):
out_file_name = "./data/friends.json"
with open(out_file_name, 'w',encoding='utf-8') as json_file:
json_file.write(json.dumps(frined_list,ensure_ascii=False))

if name == 'main':

in_file_name = './data/friends.json'
with open(in_file_name,encoding='utf-8') as f:
    friends = json.load(f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant