Python convert string to list/tuple/dictionary | Sany's Linux and Open Source Blog

Python convert string to list/tuple/dictionary | Sany's Linux and Open Source Blog

瀏覽:1421
日期:2024-07-09
By using ast modules literal_eval function we can convert any python string to valid literal. ast modules literal_eval function will only evaluates string that are valid python literals. Lets try with an example: I have file with some valid python literal...看更多