[EMAIL PROTECTED] wrote: > Hello, > > *************** > import urllib2 > import re > import string > import sys > > url = "http://www.macgyver.com/" > request = urllib2.Request(url) > opener = urllib2.build_opener() > html = opener.open(request).read() > > match = re.compile("<PRE>(.+)</PRE>", re.DOTALL) > > out = match.findall(html) > > print out > ************** > > I would like to print out string with formatting, but as I read, the > string is made into a raw string when using re. > How could I disable or bypass this?
You have a misconception here. A raw-string in python is *only* different as literal - that is, you can write r"fooo\bar" where you'd have to write "fooo\\bar" with "normal" string-literals. However, the result of both is a byte-string object that is exactly equal. So whatever out contains, it has nothing to do with raw-string or not. But what you probably mean is that putting out a list using print will use the repr()-call on the contained objects. So instead of doing print out do print "\n".join(out) or such. Diez -- http://mail.python.org/mailman/listinfo/python-list