From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: OT: Python help Date: Tue, 20 Jul 2010 13:25:52 +0200 Message-ID: <80A45277-E7F5-4E0D-AD65-E75E6D14AB9E@uva.nl> References: <97ED60B0-D01C-47DB-9B5E-10F1B39E3892@uva.nl> <83vd8a1kkv.fsf@yahoo.it> <606EFD47-1329-43F8-8496-1A0B0A2390E9@uva.nl> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=53744 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ObAxT-0002j3-Mn for emacs-orgmode@gnu.org; Tue, 20 Jul 2010 07:26:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ObAxS-0003PA-Bu for emacs-orgmode@gnu.org; Tue, 20 Jul 2010 07:25:59 -0400 Received: from pony.ic.uva.nl ([145.18.40.181]:60760) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ObAxS-0003OJ-3D for emacs-orgmode@gnu.org; Tue, 20 Jul 2010 07:25:58 -0400 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Puneeth Cc: emacs-org list 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 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> ") Thanks, that does work. - Carsten