3 ms·
In fact, it's even better than what the author said: import requests print requests.get('http://gun.io').content Only two lines!
by phzbOx 15y ago
In fact, it's even better than what the author said:
import requests
print requests.get('http://gun.io').content
Only two lines!
- blhack 15y agoWell...urllib is the same import urllib print urllib.urlopen('http://gun.io').read() And to be clear, you'd really never want to just print the content like that. You'd be doing something like. import urllib import simplejson req = urllib.urlopen("https://graph.facebook.com/some_id") response = req.read() json_data = simplejson.loads(response) (Python is syntactically pretty, imho)
- kenneth_reitz 15y agoimport requests; print requests.get('http://gun.io').content my god, python is cloud scale.
- rbonvall 15y agoIn one statement: print __import__('requests').get('http://gun.io').content
- kenneth_reitz 15y ago+1