Created
January 25, 2013 13:24
-
-
Save 013231/4634405 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
your_json = json.dumps(your_dict, ensure_ascii=False) #ensure_ascii參數阻止轉義, 並將返回值變成unicode | |
file_obj.write(your_json.encode('utf-8')) #unicode不能直接寫入文件, 需編碼成str |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment