-1
這僅僅是一個代碼示例如何解析txt文件中的信息? Python的3.0
{
"created_at": "Fri Jan 31 05:51:59 +0000 2014",
"favorited": false,
"lang": "en",
"place": {
"country_code": "US",
"url": "https://api.twitter.com/1.1/geo/id/cf44347a08102884.json"
},
"retweeted": false,
"source": "<a href=\"http://tapbots.com/software/tweetbot/mac\" rel=\"nofollow\">Tweetbot for Mac</a>",
"text": "Active crime scene on I-59/20 near Jeff/Tusc Co line. One dead, one injured; shooting involved. Police search in the area; traffic stopped",
"truncated": false
}
如何解析這個在python
這樣我就可以得到text
或lang
的信息?
txt文件和蟒蛇編碼是相互獨立的2個不同的文件。我試圖調用(在Python中)這個文本文件(稱爲CrimeReport.txt),然後解析它。我將如何做到這一點。 – kel