第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

python中,unicode對象怎么轉(zhuǎn)換成dict?

python中,unicode對象怎么轉(zhuǎn)換成dict?

LNYIE 2018-02-05 22:22:06
result = {"count":4,"sub_images":[{"url":"http://p3.pstatp.com/origin/5e8800034ace2b572928","width":690,"url_list":[{"url":"http://p3.pstatp.com/origin/5e8800034ace2b572928"},{"url":"http://pb9.pstatp.com/origin/5e8800034ace2b572928"},{"url":"http://pb1.pstatp.com/origin/5e8800034ace2b572928"}],"uri":"origin/5e8800034ace2b572928","height":1003},{"url":"http://p1.pstatp.com/origin/6158000163084595c6fb","width":690,"url_list":[{"url":"http://p1.pstatp.com/origin/6158000163084595c6fb"},{"url":"http://pb3.pstatp.com/origin/6158000163084595c6fb"},{"url":"http://pb9.pstatp.com/origin/6158000163084595c6fb"}],"uri":"origin/6158000163084595c6fb","height":975},{"url":"http://p3.pstatp.com/origin/5e820003c5d5ac717d18","width":690,"url_list":[{"url":"http://p3.pstatp.com/origin/5e820003c5d5ac717d18"},{"url":"http://pb9.pstatp.com/origin/5e820003c5d5ac717d18"},{"url":"http://pb1.pstatp.com/origin/5e820003c5d5ac717d18"}],"uri":"origin/5e820003c5d5ac717d18","height":1035},{"url":"http://p3.pstatp.com/origin/6158000163329ce51ec3","width":690,"url_list":[{"url":"http://p3.pstatp.com/origin/6158000163329ce51ec3"},{"url":"http://pb9.pstatp.com/origin/6158000163329ce51ec3"},{"url":"http://pb1.pstatp.com/origin/6158000163329ce51ec3"}],"uri":"origin/6158000163329ce51ec3","height":1035}],"max_img_width":690,"labels":["u738bu5b50u6587","Burberry","u65f6u88c5u642du914d"],"sub_abstracts":["u738bu5b50u6587u66ddu5149u6700u65b0u673au573au8857u62cduff0cu6df1u84ddu8272Burberryu5916u5957u642du914dStuart Weitzmanu9ed1u8272u957fu9774uff0cu7b80u6d01u5e05u6c14u3002u8fd9u4e48u4e45u7684u745cu4f3du679cu7136u4e0du662fu767du7ec3u7684uff0cu201cu66f2u5996u7cbeu201du9a7eu9a6du670du88c5u7684u80fdu529bu597du50cfu8d8au6765u8d8au5f3au4e86u3002"," "," "," "],"sub_titles":["u738bu5b50u6587u66ddu5149u6700u65b0u673au573au8857u62cduff0cu6df1u84ddu8272u5916u5957u642du914du9ed1u8272u957fu9774","u738bu5b50u6587u66ddu5149u6700u65b0u673au573au8857u62cduff0cu6df1u84ddu8272u5916u5957u642du914du9ed1u8272u957fu9774","u738bu5b50u6587u66ddu5149u6700u65b0u673au573au8857u62cduff0cu6df1u84ddu8272u5916u5957u642du914du9ed1u8272u957fu9774","u738bu5b50u6587u66ddu5149u6700u65b0u673au573au8857u62cduff0cu6df1u84ddu8272u5916u5957u642du914du9ed1u8272u957fu9774"]}以上result,是我在網(wǎng)頁中獲取到的,但是print type(result)顯示該對象為unicode,不是dict請問怎么樣能轉(zhuǎn)換成dict?
查看完整描述

2 回答

?
慕碼人5092043

TA貢獻13條經(jīng)驗 獲得超1個贊

result = result.encode('utf-8')? #將unicode轉(zhuǎn)換成string

jd = json.loads(result)? ?#將string轉(zhuǎn)換成dict

[如有雷同,純屬抄襲]

查看完整回答
反對 回復(fù) 2018-02-06
?
LNYIE

TA貢獻5條經(jīng)驗 獲得超0個贊

自問自答,

result = result.encode('utf-8')? #將unicode轉(zhuǎn)換成string

jd = json.loads(result)? ?#將string轉(zhuǎn)換成dict



查看完整回答
反對 回復(fù) 2018-02-05
  • 2 回答
  • 0 關(guān)注
  • 7796 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號