Snippet content copied to clipboard.
Are you sure to delete this snippet? No, don't delete

Comparison with previous snippet

  1. --- Previous Snippet
  2. +++ Current Snippet
  3. @@ -19,3 +19,3 @@
  4. "Food1 Temp": food1temp,
  5. -"Cook Name": [ cook, "foo" ]
  6. +"Cook Name": [ cook, "foo", ], # this is not 'valid JSON'
  7. }
  1. import json
  2. json_string = f'''{
  3. "Pit Target Temp": {pitTargettemp},
  4. "Fan % Output": {pitfan_output},
  5. "Food 1 Target": {food1targettemp},
  6. "Pit Temp": {pittemp},
  7. "Food1 Temp": {food1temp},
  8. "Cook Name": [ "{cook}", "foo" ]
  9. }'''
  10. json_value_1 = json.loads(json_string)
  11. json_value_2 = {
  12. "Pit Target Temp": pitTargettemp,
  13. "Fan % Output": pitfan_output,
  14. "Food 1 Target": food1targettemp,
  15. "Pit Temp": pittemp,
  16. "Food1 Temp": food1temp,
  17. "Cook Name": [ cook, "foo", ], # this is not 'valid JSON'
  18. }
  19. dump = json.dum(json_value_1) # or json_value_2, you choose

Edit this Snippet