On Feb 13, 12:51 pm, "Jordan" <[EMAIL PROTECTED]> wrote:
> On Feb 13, 8:09 am, NOSPAM plz <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hey,
>
> > My problem is, is it possible to download parts of a file while. i think
> > is it is called threading
>
> > My code thats download the whole webpage, and stunds the app while is is
> > downloading:
>
> > -----------CODE-----------
> > import urllib
> > # the heavy file to download
> > f = urllib.urlopen("http://da.wikipedia.org/wiki/Wiki";)
> > # This was supposed to print the file while it downloads
> > while 1:
> >     print f.read(100)
> > -----------/CODE-----------
>
> > In my example it just download the whole file, and then print it.
>
> > Any suggestions?
>
> > Regards
> > Andreas
>
> That's because urllib.urlopen() is not a low enough level function to
> allow what you want, it will simply open the .  Take a look inside of
> urllib.py and maybe you'll find a way to subclass the urllopen()
> function to do what you want.
>
> Cheers,
> Jordan

Sorry, my previous msg got mangled.  I meant to say that
urllib.urlopen() will simply open the webpage, you can't interrupt it
to print out what's already been downloaded.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to