Advertisement
here2share

# safe_eval.py

Oct 10th, 2019
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.12 KB | None | 0 0
  1. # safe_eval.py
  2.  
  3. import ast
  4. stringTuple = '("hello world", 20, 1.0)'
  5. t = ast.literal_eval(stringTuple)
  6. for s in t: print(s)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement