Skip to content

Instantly share code, notes, and snippets.

@ayuLiao
Created March 7, 2019 12:05
Show Gist options
  • Save ayuLiao/b506d58c07c0bae4ca49329e27617a6d to your computer and use it in GitHub Desktop.
Save ayuLiao/b506d58c07c0bae4ca49329e27617a6d to your computer and use it in GitHub Desktop.
# 当res 是 json格式的str时,loads会将其转为dict
# 通常用于,从json文件中读入数据,并使用
res = json.loads(res)
# 当 res 是 dict时,使用dumps将其转为json
res = json.dumps(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment