Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanekomasahiro/22fd1bb18ad5e31ad74a8b0ec0a13b00 to your computer and use it in GitHub Desktop.
Save kanekomasahiro/22fd1bb18ad5e31ad74a8b0ec0a13b00 to your computer and use it in GitHub Desktop.
stringタイプで記述されたリストや辞書をリストや辞書タイプに変換する.
from ast import literal_eval
s = '[1, 2, 3, 4]'
l = literal_eval(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment