import redis data=""" { "type": "carousel", "contents": [ { "type": "bubble", "size": "nano", "header": { "type": "box", "layout": "vertical", "contents": [ { "type": "text", "text": "中文測是", "color": "#ffffff", "align": "start", "size": "md", "gravity": "center" }, { "type": "text", "text": "70%", "color": "#ffffff", "align": "start", "size": "xs", "gravity": "center", "margin": "lg" } ], "backgroundColor": "#27ACB2", "paddingTop": "19px", "paddingAll": "12px", "paddingBottom": "16px" }, "body": { "type": "box", "layout": "vertical", "contents": [ { "type": "box", "layout": "horizontal", "contents": [ { "type": "text", "text": "這是一個測試efore class", "color": "#8C8C8C", "size": "sm", "wrap": true } ], "flex": 1 } ], "spacing": "md", "paddingAll": "12px" }, "styles": { "footer": { "separator": false } } }, { "type": "bubble", "size": "nano", "header": { "type": "box", "layout": "vertical", "contents": [ { "type": "text", "text": "Pending", "color": "#ffffff", "align": "start", "size": "md", "gravity": "center" }, { "type": "text", "text": "30%", "color": "#ffffff", "align": "start", "size": "xs", "gravity": "center", "margin": "lg" } ], "backgroundColor": "#FF6B6E", "paddingTop": "19px", "paddingAll": "12px", "paddingBottom": "16px" }, "body": { "type": "box", "layout": "vertical", "contents": [ { "type": "box", "layout": "horizontal", "contents": [ { "type": "text", "text": "Wash my car", "color": "#8C8C8C", "size": "sm", "wrap": true } ], "flex": 1 } ], "spacing": "md", "paddingAll": "12px" }, "styles": { "footer": { "separator": false } } }, { "type": "bubble", "size": "nano", "header": { "type": "box", "layout": "vertical", "contents": [ { "type": "text", "text": "In Progress", "color": "#ffffff", "align": "start", "size": "md", "gravity": "center" }, { "type": "text", "text": "100%", "color": "#ffffff", "align": "start", "size": "xs", "gravity": "center", "margin": "lg" } ], "backgroundColor": "#A17DF5", "paddingTop": "19px", "paddingAll": "12px", "paddingBottom": "16px" }, "body": { "type": "box", "layout": "vertical", "contents": [ { "type": "box", "layout": "horizontal", "contents": [ { "type": "text", "text": "Buy milk and lettuce before class", "color": "#8C8C8C", "size": "sm", "wrap": true } ], "flex": 1 } ], "spacing": "md", "paddingAll": "12px" }, "styles": { "footer": { "separator": false } } } ] } """ r = redis.Redis(host='db.ptt.cx', port=6379, db=2,password='choozmo9') r.set('btn_data',data)