Using Python 3 now so I had to adjust my code. Just wanted to download those 2 files, in case they do not exist (idea was that I do not have to download them every single time).
import urllib.request
if not os.path.isfile("test.mat"):
urllib.request.urlopen("http://ufldl.stanford.edu/housenumbers/test_32x32.mat", "test.mat")
if not os.path.isfile("train.mat"):
urllib.request.urlopen("http://ufldl.stanford.edu/housenumbers/train_32x32.mat", "train.mat")
The error I get is :
TypeError: POST data should be bytes or an iterable of bytes. It cannot be of type str.