trouble with urlopen in blender and ideone

As simple as

import urllib

f = urllib.urlopen("")

(not the best in syntax color selection)

Doesn’t work in Blender. The error says to check the console for now, but I don’t see anything in the Python console window or the log window. This is on OS X.

Also, I tried the same code in ideone, but no luck there either.
Something else I should be doing?

you should use


Thanks. I will certainly give that a try - but, to understand, why not use urllib.urlopen ?

oh well, my suggested line opens the default browser on that url, what you wanna do is reading from a network address right? That’s of course not the same, but still, as python scripts block blender until finished, it’s not advised to do possibly long-asting I/O actions.

Anyway, if you wanna use urllib, make sure to check the python 3 docs, it changed a bit:

so it’s

from urllib.request import urlopen

Thanks CoDEmanX - that worked well.