Re: Python strings question (vertical stack)

2007-11-20 Thread J. Clifford Dyer
On Tue, 2007-11-20 at 13:59 -0800, John Machin wrote: > On Nov 21, 7:15 am, Farshid Lashkari <[EMAIL PROTECTED]> wrote: > > J. Clifford Dyer wrote: > > > I think you mean '\n'.join([string1,string2,string3]) > > > > > You actually do want the \ to do its thing in this case. > > > > Yeah, my brain m

Re: Python strings question (vertical stack)

2007-11-20 Thread Diez B. Roggisch
dmitrey schrieb: > Thanks all, I have solved the problem: > > a=""" > %s > %s > %s > """ % ('asdf', 'asdf2', 'asdf3') > > print a This is more expensive and not as flexible as the join method. At least for growing string-lengths and number of arguments. Diez -- http://mail.python.org/mailman/

Re: Python strings question (vertical stack)

2007-11-20 Thread John Machin
James Matthews top-posted: > I would say to split it by the newline! Split what by which newline? The OP appeared to be wanting some kind of UNsplit ... > > On Nov 20, 2007 10:59 PM, John Machin <[EMAIL PROTECTED] > > wrote: > > On Nov 21, 7:15 am, Farshid Lashkari

Re: Python strings question (vertical stack)

2007-11-20 Thread James Matthews
I would say to split it by the newline! On Nov 20, 2007 10:59 PM, John Machin <[EMAIL PROTECTED]> wrote: > On Nov 21, 7:15 am, Farshid Lashkari <[EMAIL PROTECTED]> wrote: > > J. Clifford Dyer wrote: > > > I think you mean '\n'.join([string1,string2,string3]) > > > > > You actually do want the \ t

Re: Python strings question (vertical stack)

2007-11-20 Thread John Machin
On Nov 21, 7:15 am, Farshid Lashkari <[EMAIL PROTECTED]> wrote: > J. Clifford Dyer wrote: > > I think you mean '\n'.join([string1,string2,string3]) > > > You actually do want the \ to do its thing in this case. > > Yeah, my brain must still be asleep. Thanks for waking it up :) You're not alone :-

Re: Python strings question (vertical stack)

2007-11-20 Thread Farshid Lashkari
J. Clifford Dyer wrote: > I think you mean '\n'.join([string1,string2,string3]) > > You actually do want the \ to do its thing in this case. Yeah, my brain must still be asleep. Thanks for waking it up :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python strings question (vertical stack)

2007-11-20 Thread J. Clifford Dyer
On Tue, Nov 20, 2007 at 11:40:59AM -0800, Farshid Lashkari wrote regarding Re: Python strings question (vertical stack): > > dmitrey wrote: > > Hi all, > > I have some strings, let it be string1, string2, string3. > > > > So how could String= > > &qu

Re: Python strings question (vertical stack)

2007-11-20 Thread dmitrey
Thanks all, I have solved the problem: a=""" %s %s %s """ % ('asdf', 'asdf2', 'asdf3') print a D. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python strings question (vertical stack)

2007-11-20 Thread Farshid Lashkari
dmitrey wrote: > Hi all, > I have some strings, let it be string1, string2, string3. > > So how could String= > """ > string1 > string2 > string3 > """ > > be obtained? > > Thank you in advance, D. If you just want the to add newlines between the strings then you can do the following: String

Python strings question (vertical stack)

2007-11-20 Thread dmitrey
Hi all, I have some strings, let it be string1, string2, string3. So how could String= """ string1 string2 string3 """ be obtained? Thank you in advance, D. -- http://mail.python.org/mailman/listinfo/python-list