You really don't even need to do `json.dumps`...you could just do `'{"count":%d}' % num`