Re: [Orgmode] OT: Python help

2010-07-20 Thread Xiao-Yong Jin
On Tue, 20 Jul 2010 14:08:32 +0100, Peter Westlake wrote: > On Tue, 20 Jul 2010 16:58 +0530, "Puneeth" wrote: > Here's a Pythonic way to do it, tested: > import re > my_string = "Hello\nWorld" > pattern = re.compile('^',re.MULTILINE) > my_new_string = re.sub(pattern, '> ', my_string) >

Re: [Orgmode] OT: Python help

2010-07-20 Thread Peter Westlake
On Tue, 20 Jul 2010 16:58 +0530, "Puneeth" wrote: > On Tue, Jul 20, 2010 at 4:50 PM, Puneeth wrote: > > On Tue, Jul 20, 2010 at 4:43 PM, Carsten Dominik wrote: > >> Please show me the full line of code, I am currently editing a python > >> script > >> without any knowledge of python... > > >

Re: [Orgmode] OT: Python help

2010-07-20 Thread Carsten Dominik
On Jul 20, 2010, at 3:08 PM, Peter Westlake wrote: On Tue, 20 Jul 2010 16:58 +0530, "Puneeth" wrote: On Tue, Jul 20, 2010 at 4:50 PM, Puneeth wrote: On Tue, Jul 20, 2010 at 4:43 PM, Carsten Dominik wrote: Please show me the full line of code, I am currently editing a python script

Re: [Orgmode] OT: Python help

2010-07-20 Thread Puneeth
On Tue, Jul 20, 2010 at 4:50 PM, Puneeth wrote: > On Tue, Jul 20, 2010 at 4:43 PM, Carsten Dominik wrote: >> Please show me the full line of code, I am currently editing a python script >> without any knowledge of python... > > my_string = "Hello\nWorld" > my_new_string = my_string.replace("\n",

Re: [Orgmode] OT: Python help

2010-07-20 Thread Carsten Dominik
On Jul 20, 2010, at 1:20 PM, Puneeth wrote: On Tue, Jul 20, 2010 at 4:43 PM, Carsten Dominik wrote: On Jul 20, 2010, at 1:03 PM, Giovanni Ridolfi wrote: Carsten Dominik writes: a python question: How do I prefix every line in a multiline string with a string. For example, I would l

Re: [Orgmode] OT: Python help

2010-07-20 Thread Giovanni Ridolfi
Carsten Dominik writes: > On Jul 20, 2010, at 1:03 PM, Giovanni Ridolfi wrote: > >> Carsten Dominik writes: >> >> >>> a python question: How do I prefix every line in a multiline string >>> with a string. For example, I would like to add "> " before all >>> lines >>> in a string >> >> how

Re: [Orgmode] OT: Python help

2010-07-20 Thread Puneeth
On Tue, Jul 20, 2010 at 4:43 PM, Carsten Dominik wrote: > > On Jul 20, 2010, at 1:03 PM, Giovanni Ridolfi wrote: > >> Carsten Dominik writes: >> >> >>> a python question:  How do I prefix every line in a multiline string >>> with a string.  For example, I would like to add "> " before all lines >

Re: [Orgmode] OT: Python help

2010-07-20 Thread Carsten Dominik
On Jul 20, 2010, at 1:03 PM, Giovanni Ridolfi wrote: Carsten Dominik writes: a python question: How do I prefix every line in a multiline string with a string. For example, I would like to add "> " before all lines in a string how about replacing "\n" with "\n > " ? Please show

Re: [Orgmode] OT: Python help

2010-07-20 Thread Giovanni Ridolfi
Carsten Dominik writes: > a python question: How do I prefix every line in a multiline string > with a string. For example, I would like to add "> " before all lines > in a string how about replacing "\n" with "\n > " ? Giovanni ___ Emacs-orgm

[Orgmode] OT: Python help

2010-07-20 Thread Carsten Dominik
Hi there, a python question: How do I prefix every line in a multiline string with a string. For example, I would like to add "> " before all lines in a string Thanks - Carsten ___ Emacs-orgmode mailing list Please use `Reply All' to send