Re: "Disabling" raw string to print newlines

2008-05-19 Thread kuratkull
On May 19, 4:01 pm, Paul McGuire <[EMAIL PROTECTED]> wrote: > On May 19, 4:54 am, [EMAIL PROTECTED] wrote: > > > > > Hello, > > > *** > > import urllib2 > > import re > > import string > > import sys > > > url = "http://www.macgyver.com/"; > > request = urllib2.Request(url) > > opener =

Re: "Disabling" raw string to print newlines

2008-05-19 Thread Paul McGuire
On May 19, 8:09 am, Paul McGuire <[EMAIL PROTECTED]> wrote: > On May 19, 4:54 am, [EMAIL PROTECTED] wrote:> Hello, > > > > > > > print out > > ** > > Since you have no control over spacing and line breaks in the input, > you can reformat using the textwrap module.  First replace all "\

Re: "Disabling" raw string to print newlines

2008-05-19 Thread Paul McGuire
On May 19, 4:54 am, [EMAIL PROTECTED] wrote: > Hello, > > > print out > ** Since you have no control over spacing and line breaks in the input, you can reformat using the textwrap module. First replace all "\n"s with " ", then use re.sub to replace multiple spaces with a single space

Re: "Disabling" raw string to print newlines

2008-05-19 Thread Paul McGuire
On May 19, 4:54 am, [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("(

Re: "Disabling" raw string to print newlines

2008-05-19 Thread Diez B. Roggisch
[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("(.+)", re.DOTALL)

"Disabling" raw string to print newlines

2008-05-19 Thread kuratkull
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("(.+)", re.DOTALL) out = match.findall(html) print out **