Similarly, it’s an import and 2 function calls to get a file off the internet.
I only count one function call:
import requests
f = requests.get(my_url).text
The built-in urllib and urllib2 modules can do this too, but they’re a disaster that should be buried in the ground. The general consensus is that requests is the Right Thing. You have to install it, but that should be easy with the pip package manager:
$ pip install requests
By the way, I agree with the recommendation of Python. It’s a very easy language to get started with, and it’s practical for all sorts of things. YouTube, for example, is mostly written in Python.
I only count one function call:
The built-in urllib and urllib2 modules can do this too, but they’re a disaster that should be buried in the ground. The general consensus is that requests is the Right Thing. You have to install it, but that should be easy with the pip package manager:
By the way, I agree with the recommendation of Python. It’s a very easy language to get started with, and it’s practical for all sorts of things. YouTube, for example, is mostly written in Python.
Thanks for requests!