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

瀏覽:468
日期:2024-07-16
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...看更多