Download parts not whole file in ones
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
--
http://mail.python.org/mailman/listinfo/python-list
Regex highlight html
Hey, I want to write a function that highlights html code. I have read the wiki page http://en.wikipedia.org/wiki/Regular_expressions just like this: test to this: test Just example colors - not so pretty :) Any suggestions? Andreas -- http://mail.python.org/mailman/listinfo/python-list
Re: Regex highlight html
Hey, I want to write a function that highlights html code. I have read the wiki page http://en.wikipedia.org/wiki/Regular_expressions just like this: test to this: ="test.png" alt="test pic" height="100" width="100"> ="#">test Just example colors - not so pretty :) Any suggestions? Andreas -- http://mail.python.org/mailman/listinfo/python-list
Re: Mulig SPAM: float print formatting
hg skrev: > Hi, > > Considering the float 0.0, I would like to print 00.00. > > I tried '%02.02f' % 0.0 ... but I get 0.00 > > Any clue ? > > Thanks, > > hg > > Try this: a = 45.45 # the floating number print "some text", print a, print "some text again" or just this: print "some text", print 45.45, print "some text again" Hope it helped :D Andreas -- http://mail.python.org/mailman/listinfo/python-list
Re: Regex highlight html
Gabriel Genellina skrev: > En Tue, 13 Feb 2007 10:13:26 -0300, NOSPAM plz <[EMAIL PROTECTED]> > escribió: > > >> I want to write a function that highlights html code. >> > > Well, it's already done, you have Pygments http://pygments.pocoo.org/ > and SilverCity http://silvercity.sourceforge.net/ > > >> I have read the wiki page >> http://en.wikipedia.org/wiki/Regular_expressions >> > > Ouch... Read some previous posts on why it's not a good idea to use > regexps for parsing html code. > > Thanks just what i needed :D! -- http://mail.python.org/mailman/listinfo/python-list
