0
我正在使用Twitter API和Python,當我嘗試合併檢索的JSON頁面時遇到了問題。使用twitter JSON響應
的JSON的每個請求檢索的結構是:
{
"previous_cursor": 0,
"previous_cursor_str": "0",
"next_cursor": 1333504313713126852,
"users": [
{
"foo": "bar",
"foo": "bar",
"foo": "bar",
"foo": "bar",
"foo": "bar"
},
{
"foo": "bar",
"foo": "bar",
"foo": "bar",
"foo": "bar",
"foo": "bar"
},
{
"foo": "bar",
"foo": "bar",
"foo": "bar",
"foo": "bar",
"foo": "bar"
}
],
"next_cursor_str": "1333504313713126852"
}
我需要合併的所有數據在一個列表contaning每個用戶的信息。問題是,當我這樣做,我得到這樣的結構:
friends_list = [friends_list, raw_friends_list['users']]
[
{"foo": "bar","foo": "bar"}
{"foo": "bar","foo": "bar"}
{"foo": "bar","foo": "bar"}
]
[
{"foo": "bar","foo": "bar"}
{"foo": "bar","foo": "bar"}
{"foo": "bar","foo": "bar"}
]
相反的:
[
{"foo": "bar","foo": "bar"}
{"foo": "bar","foo": "bar"}
{"foo": "bar","foo": "bar"}
{"foo": "bar","foo": "bar"}
{"foo": "bar","foo": "bar"}
{"foo": "bar","foo": "bar"}
]
有誰知道一個適當的方式與Python實現這一目標?
問候,
這正是我需要的,非常感謝你 – Nucklear 2013-04-26 11:51:05