As much as I think it's annoying I think no trailing commas enforces good coding hygiene and basically forces you to use a real encoder rather than as hoc string manipulations.
print("{")
for elem in list:
print('"key": "value",')
print("}")
seems like immediate worth. print("{")
contents = ""
for elem in list:
contents += '"key": "value",'
print(contents[:-1])
print("}")