Convert Python dictionary to JSON array

前端 未结 4 1233
时光取名叫无心
时光取名叫无心 2020-12-04 15:56

Currently I have this dictionary, printed using pprint:

{\'AlarmExTempHum\': \'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\',  
\'AlarmIn\': 0,           


        
4条回答
  •  鱼传尺愫
    2020-12-04 16:33

    If you use Python 2, don't forget to add the UTF-8 file encoding comment on the first line of your script.

    # -*- coding: UTF-8 -*-
    

    This will fix some Unicode problems and make your life easier.

提交回复
热议问题