擅长:python、mysql、java
<p>我猜您实际上想从URL获取数据:</p>
<pre><code>jsonurl = urlopen(url)
text = json.loads(jsonurl.read()) # <-- read from it
</code></pre>
<p>或者,在<a href="http://docs.python-requests.org/en/latest/">requests</a>库中签出<a href="http://docs.python-requests.org/en/latest/user/quickstart/#json-response-content">JSON decoder</a>。</p>
<pre><code>import requests
r = requests.get('someurl')
print r.json() # if response type was set to JSON, then you'll automatically have a JSON response here...
</code></pre>