Re: text formatting question

2013-03-01 Thread Chris Angelico
On Sat, Mar 2, 2013 at 12:52 AM, Dave Angel wrote: > The assumption Chris made is that the characters XYC do *not* appear > anywhere else in each string. if they do, then you need to write a spec as > to what criteria you can count on for the data. > Right. I should have mentioned that. Let's ho

Re: text formatting question

2013-03-01 Thread Dave Angel
On 03/01/2013 02:08 AM, idy wrote: On Friday, March 1, 2013 12:23:41 PM UTC+5:30, Chris Angelico wrote: You want to break the line immediately before the 'XYC'? That's quite easy; the line break is a character like any other, and can be used in a replace() call: formatted_error = Error.

Re: text formatting question

2013-02-28 Thread idy
On Friday, March 1, 2013 12:23:41 PM UTC+5:30, Chris Angelico wrote: > On Fri, Mar 1, 2013 at 5:49 PM, idy wrote: > > > Error = > > 'XYC.12345455LOcation/user/data/MYGLE-INGXYC.23344566LOcation/user/data/INGE-FTYXYC.22334566LOcation/user/data/GETN-YUNXYC.12345455LOcation/user/data/MYGLE-INGXYC.1

Re: text formatting question

2013-02-28 Thread Chris Angelico
On Fri, Mar 1, 2013 at 5:49 PM, idy wrote: > Error = > 'XYC.12345455LOcation/user/data/MYGLE-INGXYC.23344566LOcation/user/data/INGE-FTYXYC.22334566LOcation/user/data/GETN-YUNXYC.12345455LOcation/user/data/MYGLE-INGXYC.111LOcation/user/data/INGE-FTYXYC.333LOcation/user/data/GETN-YUN' > > I

text formatting question

2013-02-28 Thread idy
I have a text string of this format Error = 'XYC.12345455LOcation/user/data/MYGLE-INGXYC.23344566LOcation/user/data/INGE-FTYXYC.22334566LOcation/user/data/GETN-YUNXYC.12345455LOcation/user/data/MYGLE-INGXYC.111LOcation/user/data/INGE-FTYXYC.333LOcation/user/data/GETN-YUN' I need to writ

Re: HTML/text formatting question

2005-08-25 Thread Edvard Majakari
"Dr. Who" <[EMAIL PROTECTED]> writes: > This seems clunky and my next step was going to be to define generic > functions which would generate the surrounding html tags only when > passed the proper argument. I was wondering if there was a better way > to do this with a standard Python library. I

Re: HTML/text formatting question

2005-08-03 Thread Steven Bethard
Dr. Who wrote: > I have a tool that outputs data in either html or text output. > > Currently I'm writing chucnks like: > > if html: > print '' > print '' > print '' > print 'Differences %s: %s' % (htypestr, lbl1) > if html: > ... I'd create two Formatter classes, one for HTML

HTML/text formatting question

2005-08-03 Thread Dr. Who
I have a tool that outputs data in either html or text output. Currently I'm writing chucnks like: if html: print '' print '' print '' print 'Differences %s: %s' % (htypestr, lbl1) if html: ... This seems clunky and my next step was going to be to define generic functions whi