Thx for help,
extreme lack of free time lately,
will look into it.
[Wouldn't've noticed myself that urlopen is not a class.]
On Tue, Dec 23, 2008 at 6:03 PM, Richard Lovely
wrote:
> OK, going on Kent's post:
>
> from urllib import urlopen
>
> class fetch(object):
>def __init__(self, *args):
OK, going on Kent's post:
from urllib import urlopen
class fetch(object):
def __init__(self, *args):
self.response = urlopen(*args)
self.content = self.response.read()
I forgot urlopen was a function. It made sense in my head for it to
be a class, instead of _returning_ a c
On Tue, Dec 23, 2008 at 9:31 AM, Omer wrote:
from urllib import urlopen
class fetch(urlopen):
> ... def __init__(self,*args):
> ... urlopen.__init__(self, *args)
> ... self.content = self.read()
> ...
>
> Traceback (most recent call last):
> File "", line 1, in
>
Hey!
Thx for the help,
@Martin,
At the moment my only need is basic retrievals of source code of basic files
from the internet, so no need for urllib2 or response objects just yet.
Now, copying and pasting line by line into the interactive mode I get this:
>>> from urllib import urlopen
>>> cl