[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] OT: Python help
From: |
Puneeth |
Subject: |
Re: [Orgmode] OT: Python help |
Date: |
Tue, 20 Jul 2010 16:50:29 +0530 |
On Tue, Jul 20, 2010 at 4:43 PM, Carsten Dominik <address@hidden> wrote:
>
> On Jul 20, 2010, at 1:03 PM, Giovanni Ridolfi wrote:
>
>> Carsten Dominik <address@hidden> 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 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", "\n> ")
HTH,
Puneeth
- [Orgmode] OT: Python help, Carsten Dominik, 2010/07/20
- Re: [Orgmode] OT: Python help, Giovanni Ridolfi, 2010/07/20
- Re: [Orgmode] OT: Python help, Carsten Dominik, 2010/07/20
- Re: [Orgmode] OT: Python help,
Puneeth <=
- Re: [Orgmode] OT: Python help, Carsten Dominik, 2010/07/20
- Re: [Orgmode] OT: Python help, Puneeth, 2010/07/20
- Re: [Orgmode] OT: Python help, Peter Westlake, 2010/07/20
- Re: [Orgmode] OT: Python help, Carsten Dominik, 2010/07/20
- Re: [Orgmode] OT: Python help, Xiao-Yong Jin, 2010/07/20
- Re: [Orgmode] OT: Python help, Giovanni Ridolfi, 2010/07/20