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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

我們?nèi)绾问褂胮ython獲取dist的數(shù)據(jù)列表

我們?nèi)绾问褂胮ython獲取dist的數(shù)據(jù)列表

慕勒3428872 2023-07-11 14:30:34
我想從下面的代碼中獲取數(shù)據(jù):data=[{'f': [{'@id': '6', '#text': 'Application Review'}, {'@id': '7', '#text': 'final demo'}, {'@id': '8', 'url': '', '#text': 'Sample Document.docx'}, {'@id': '3', '#text': '3'}], 'update_id': '1598972807556'}, {'f': [{'@id': '6', '#text': 'Track Record data'}, {'@id': '7', '#text': 'Track Record data'}, {'@id': '8', 'url': '', '#text': 'Testing Guidelines-QuickBase.docx'}, {'@id': '3', '#text': '1'}], 'update_id': '1597820400040'}]我需要值或文本輸出: Application reveiw   final demo so on謝謝
查看完整描述

1 回答

?
青春有我

TA貢獻(xiàn)1784條經(jīng)驗(yàn) 獲得超8個(gè)贊

這只是循環(huán)遍歷所有各種字典和列表的問題:


>>> data=[{'f': [{'@id': '6', '#text': 'Application Review'}, {'@id': '7', '#text': 'final demo'}, {'@id': '8', 'url': '', '#text': 'Sample Document.docx'}, {'@id': '3', '#text': '3'}], 'update_id': '1598972807556'}, {'f': [{'@id': '6', '#text': 'Track Record data'}, {'@id': '7', '#text': 'Track Record data'}, {'@id': '8', 'url': '', '#text': 'Testing Guidelines-QuickBase.docx'}, {'@id': '3', '#text': '1'}], 'update_id': '1597820400040'}]

>>> print('\n'.join([e['#text'] for d in data for e in d['f']]))

Application Review

final demo

Sample Document.docx

3

Track Record data

Track Record data

Testing Guidelines-QuickBase.docx

1


查看完整回答
反對(duì) 回復(fù) 2023-07-11
  • 1 回答
  • 0 關(guān)注
  • 183 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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