TypeError: Object of type is not JSON serializable
📁 python
Estou tentando gravar um objeto da classe Person assim:
def postUserToJson(user):
filename = str(user.fullname) + "" + str(user.id)
file = open(PathUsers + filename + ".json", "w", encoding="utf-8")
json.dump(user, file, ensure_ascii=false)
file.close()
Recebo um erro:
TypeError: Object of type No answers yet.
Faça login para deixar uma resposta
Blogs
Salários de desenvolvedores TypeScript na Rússia: panorama do mercado 2024