How are you sending the file, sockets, over API,...?, but if you are load a json result should use json library specify dumps and loads method could work to you
https://es.coursera.org/specializations/data-science-python check that ? or search youtube tutorials ?
what happend with "trez" ? xD, i don't care about that
I believe you refer to serialize some file, right?