You should use the json module instead of hand-coding it.