Re: assigning multi-line strings to variables

2010-05-02 Thread Sibylle Koczian
goldtech schrieb: Thank you to posters for help to my question. Seems I had trouble with triple quotes strings in the PythonWin shell. But using the Idle shell things work as expected. But this is probably another issue...any way, w/Idle's shell I got the "action" regarding multiline strings I ex

Re: assigning multi-line strings to variables

2010-04-30 Thread Lie Ryan
On 05/01/10 07:54, Alf P. Steinbach wrote: > You'd put a 5K line in your source code, + you're working with text wrapping in your editor. >>> >>> In the other hand, you'd put a 5K line in your source code, + you're >>> writing, debugging, and running a script to wrap and put vari

Re: assigning multi-line strings to variables

2010-04-30 Thread Alf P. Steinbach
On 30.04.2010 21:40, * Lie Ryan: On 05/01/10 04:08, Neil Cerutti wrote: On 2010-04-30, Lie Ryan wrote: Use triple-quoted, let them flow, done. I've never heard of any text editor in current use without text wrapping capability, even Notepad has it. And if I've got 5k of text in source code wi

Re: assigning multi-line strings to variables

2010-04-30 Thread Alf P. Steinbach
On 30.04.2010 21:46, * Lie Ryan: On 05/01/10 05:43, Lie Ryan wrote: On 05/01/10 03:56, Alf P. Steinbach wrote: Use triple-quoted, let them flow, done. I've never heard of any text editor in current use without text wrapping capability, even Notepad has it. And if I've got 5k of text in source

Re: assigning multi-line strings to variables

2010-04-30 Thread Lie Ryan
On 05/01/10 05:43, Lie Ryan wrote: > On 05/01/10 03:56, Alf P. Steinbach wrote: >>> >>> Use triple-quoted, let them flow, done. I've never heard of any text >>> editor in current use without text wrapping capability, even Notepad has >>> it. And if I've got 5k of text in source code without line b

Re: assigning multi-line strings to variables

2010-04-30 Thread Lie Ryan
On 05/01/10 03:56, Alf P. Steinbach wrote: >> >> Use triple-quoted, let them flow, done. I've never heard of any text >> editor in current use without text wrapping capability, even Notepad has >> it. And if I've got 5k of text in source code without line breaks I >> wouldn't want that silly strin

Re: assigning multi-line strings to variables

2010-04-30 Thread Lie Ryan
On 05/01/10 04:08, Neil Cerutti wrote: > On 2010-04-30, Lie Ryan wrote: >> Use triple-quoted, let them flow, done. I've never heard of any >> text editor in current use without text wrapping capability, >> even Notepad has it. And if I've got 5k of text in source code >> without line breaks I wou

Re: assigning multi-line strings to variables

2010-04-30 Thread Neil Cerutti
On 2010-04-30, Lie Ryan wrote: > Use triple-quoted, let them flow, done. I've never heard of any > text editor in current use without text wrapping capability, > even Notepad has it. And if I've got 5k of text in source code > without line breaks I wouldn't want that silly string to > disturb my

Re: assigning multi-line strings to variables

2010-04-30 Thread Alf P. Steinbach
On 30.04.2010 19:31, * Lie Ryan: On 05/01/10 00:01, Alf P. Steinbach wrote: On 30.04.2010 12:51, * Lie Ryan: On 04/30/10 12:07, Alf P. Steinbach wrote: On 30.04.2010 01:29, * Carl Banks: On Apr 28, 11:16 am, "Alf P. Steinbach"wrote: On 28.04.2010 18:54, * Lie Ryan: Python have triple-

Re: assigning multi-line strings to variables

2010-04-30 Thread Lie Ryan
On 05/01/10 00:01, Alf P. Steinbach wrote: > On 30.04.2010 12:51, * Lie Ryan: >> On 04/30/10 12:07, Alf P. Steinbach wrote: >>> On 30.04.2010 01:29, * Carl Banks: On Apr 28, 11:16 am, "Alf P. Steinbach" wrote: > On 28.04.2010 18:54, * Lie Ryan: >> Python have triple-quoted strin

Re: assigning multi-line strings to variables

2010-04-30 Thread Alf P. Steinbach
On 30.04.2010 12:51, * Lie Ryan: On 04/30/10 12:07, Alf P. Steinbach wrote: On 30.04.2010 01:29, * Carl Banks: On Apr 28, 11:16 am, "Alf P. Steinbach" wrote: On 28.04.2010 18:54, * Lie Ryan: Python have triple-quoted string when you want to include large amount of text; Yes, that's been

Re: assigning multi-line strings to variables

2010-04-30 Thread Lie Ryan
On 04/30/10 12:07, Alf P. Steinbach wrote: > On 30.04.2010 01:29, * Carl Banks: >> On Apr 28, 11:16 am, "Alf P. Steinbach" wrote: >>> On 28.04.2010 18:54, * Lie Ryan: >> Python have triple-quoted string when you want to include large amount of text; >>> >>> Yes, that's been mentioned ump

Re: assigning multi-line strings to variables

2010-04-30 Thread Lie Ryan
On 04/30/10 13:21, Steven D'Aprano wrote: > On Fri, 30 Apr 2010 05:41:26 +1000, Lie Ryan wrote: > >> On 04/29/10 20:40, Gregory Ewing wrote: >>> Lie Ryan wrote: No, the implicit concatenation is there because Python didn't always have triple quoted string. Nowadays it's an artifact and t

Re: assigning multi-line strings to variables

2010-04-29 Thread Steven D'Aprano
On Fri, 30 Apr 2010 05:41:26 +1000, Lie Ryan wrote: > On 04/29/10 20:40, Gregory Ewing wrote: >> Lie Ryan wrote: >>> No, the implicit concatenation is there because Python didn't always >>> have triple quoted string. Nowadays it's an artifact and triple quoted >>> string is much preferred. >> >>

Re: assigning multi-line strings to variables

2010-04-29 Thread Alf P. Steinbach
On 30.04.2010 01:29, * Carl Banks: On Apr 28, 11:16 am, "Alf P. Steinbach" wrote: On 28.04.2010 18:54, * Lie Ryan: Python have triple-quoted string when you want to include large amount of text; Yes, that's been mentioned umpteen times in this thread, including the *very first* quoted sent

Re: assigning multi-line strings to variables

2010-04-29 Thread Carl Banks
On Apr 28, 11:16 am, "Alf P. Steinbach" wrote: > On 28.04.2010 18:54, * Lie Ryan: > > Python have triple-quoted string when you want to include large amount > > of text; > > Yes, that's been mentioned umpteen times in this thread, including the *very > first* quoted sentence above. > > It's IMHO

Re: assigning multi-line strings to variables

2010-04-29 Thread Lie Ryan
On 04/29/10 16:34, Steven D'Aprano wrote: > On Thu, 29 Apr 2010 02:16:46 +0100, MRAB wrote: > >> Steven D'Aprano wrote: >>> On Thu, 29 Apr 2010 06:17:42 +1000, Lie Ryan wrote: >>> > Consider that the concatenation language feature probably is there > because it's useful (e.g. it preserves

Re: assigning multi-line strings to variables

2010-04-29 Thread Lie Ryan
On 04/29/10 20:40, Gregory Ewing wrote: > Lie Ryan wrote: >> No, the implicit concatenation is there because Python didn't always >> have triple quoted string. Nowadays it's an artifact and triple quoted >> string is much preferred. > > I don't agree. I often use implicit concatenation when I'm >

Re: assigning multi-line strings to variables

2010-04-29 Thread goldtech
Thank you to posters for help to my question. Seems I had trouble with triple quotes strings in the PythonWin shell. But using the Idle shell things work as expected. But this is probably another issue...any way, w/Idle's shell I got the "action" regarding multiline strings I expected. -- http://m

Re: assigning multi-line strings to variables

2010-04-29 Thread Gregory Ewing
Lie Ryan wrote: No, the implicit concatenation is there because Python didn't always have triple quoted string. Nowadays it's an artifact and triple quoted string is much preferred. I don't agree. I often use implicit concatenation when I'm writing a format string that won't fit on one source l

Re: assigning multi-line strings to variables

2010-04-28 Thread Steven D'Aprano
On Thu, 29 Apr 2010 02:16:46 +0100, MRAB wrote: > Steven D'Aprano wrote: >> On Thu, 29 Apr 2010 06:17:42 +1000, Lie Ryan wrote: >> Consider that the concatenation language feature probably is there because it's useful (e.g. it preserves indentation and allows per line comments). >>

Re: assigning multi-line strings to variables

2010-04-28 Thread MRAB
Steven D'Aprano wrote: On Thu, 29 Apr 2010 06:17:42 +1000, Lie Ryan wrote: Consider that the concatenation language feature probably is there because it's useful (e.g. it preserves indentation and allows per line comments). No, the implicit concatenation is there because Python didn't always h

Re: assigning multi-line strings to variables

2010-04-28 Thread Ben Finney
Lie Ryan writes: > Python have triple-quoted string when you want to include large amount > of text; there is no need to split the string up manually or even > scriptically. You can even have multi-line string literals that have correct indentation in the code, but strip that indentation at runt

Re: assigning multi-line strings to variables

2010-04-28 Thread Steven D'Aprano
On Thu, 29 Apr 2010 06:17:42 +1000, Lie Ryan wrote: >> Consider that the concatenation language feature probably is there >> because it's useful (e.g. it preserves indentation and allows per line >> comments). > > No, the implicit concatenation is there because Python didn't always > have triple

Re: assigning multi-line strings to variables

2010-04-28 Thread Lie Ryan
On 04/29/10 04:16, Alf P. Steinbach wrote: > On 28.04.2010 18:54, * Lie Ryan: >> On 04/28/10 15:34, Alf P. Steinbach wrote: > > Yes, that's been mentioned umpteen times in this thread, including the > *very first* quoted sentence above. > > It's IMHO sort of needless to repeat that after quoting

Re: assigning multi-line strings to variables

2010-04-28 Thread Alf P. Steinbach
On 28.04.2010 18:54, * Lie Ryan: On 04/28/10 15:34, Alf P. Steinbach wrote: On 28.04.2010 07:11, * Sagar K: Use triple quote: d = """ this is a sample text which does not mean anything""" "goldtech" wrote in message news:4e25733e-eafa-477b-a84d-a64d139f7...@u34g2000yqu.googlegroups.com... On

Re: assigning multi-line strings to variables

2010-04-28 Thread Lie Ryan
On 04/28/10 15:34, Alf P. Steinbach wrote: > On 28.04.2010 07:11, * Sagar K: >> Use triple quote: >> d = """ this is >> a sample text >> which does >> not mean >> anything""" >> >> "goldtech" wrote in message >> news:4e25733e-eafa-477b-a84d-a64d139f7...@u34g2000yqu.googlegroups.com... >> On Apr 27

Re: assigning multi-line strings to variables

2010-04-28 Thread cjw
On 27-Apr-10 22:31 PM, Brendan Abel wrote: On Apr 27, 7:20 pm, goldtech wrote: Hi, This is undoubtedly a newbie question. How doI assign variables multiline strings? If I try this i get what's cited below. Thanks. d="d d" d Traceback (most recent call last): File "", line 1, i

Re: assigning multi-line strings to variables

2010-04-27 Thread Alf P. Steinbach
On 28.04.2010 07:11, * Sagar K: Use triple quote: d = """ this is a sample text which does not mean anything""" "goldtech" wrote in message news:4e25733e-eafa-477b-a84d-a64d139f7...@u34g2000yqu.googlegroups.com... On Apr 27, 7:31 pm, Brendan Abel<007bren...@gmail.com> wrote: On Apr 27, 7:20 p

Re: assigning multi-line strings to variables

2010-04-27 Thread Sagar K
Use triple quote: d = """ this is a sample text which does not mean anything""" "goldtech" wrote in message news:4e25733e-eafa-477b-a84d-a64d139f7...@u34g2000yqu.googlegroups.com... On Apr 27, 7:31 pm, Brendan Abel <007bren...@gmail.com> wrote: > On Apr 27, 7:20 pm, goldtech wrote: > > > Hi, >

Re: assigning multi-line strings to variables

2010-04-27 Thread Ben Finney
goldtech writes: > Only seems to work when there's a '... ' on the 2nd line. You seem to be confused by the presentation of the interactive interpreter. That text is a prompt. > I need a way to assign large blocks of text to a variable w/out > special formatting. That's what triple-quoted stri

Re: assigning multi-line strings to variables

2010-04-27 Thread MRAB
goldtech wrote: On Apr 27, 7:33 pm, MRAB wrote: goldtech wrote: Hi, This is undoubtedly a newbie question. How doI assign variables multiline strings? If I try this i get what's cited below. Thanks. d="d d" d Traceback (most recent call last): File "", line 1, in NameError: name

Re: assigning multi-line strings to variables

2010-04-27 Thread geremy condra
On Tue, Apr 27, 2010 at 10:51 PM, goldtech wrote: > On Apr 27, 7:33 pm, MRAB wrote: >> goldtech wrote: >> > Hi, >> >> > This is undoubtedly a newbie question. How doI assign variables >> > multiline strings? If I try this i get what's cited below. Thanks. >> >> d="d >> > d" >> d

Re: assigning multi-line strings to variables

2010-04-27 Thread Benjamin Kaplan
On Tue, Apr 27, 2010 at 10:51 PM, goldtech wrote: > On Apr 27, 7:33 pm, MRAB wrote: > > goldtech wrote: > > > Hi, > > > > > This is undoubtedly a newbie question. How doI assign variables > > > multiline strings? If I try this i get what's cited below. Thanks. > > > > d="d > > > d"

Re: assigning multi-line strings to variables

2010-04-27 Thread goldtech
On Apr 27, 7:33 pm, MRAB wrote: > goldtech wrote: > > Hi, > > > This is undoubtedly a newbie question. How doI assign variables > > multiline strings? If I try this i get what's cited below. Thanks. > > d="d > > d" > d > > Traceback (most recent call last): > >   File "", line 1,

Re: assigning multi-line strings to variables

2010-04-27 Thread goldtech
On Apr 27, 7:31 pm, Brendan Abel <007bren...@gmail.com> wrote: > On Apr 27, 7:20 pm, goldtech wrote: > > > Hi, > > > This is undoubtedly a newbie question. How doI assign variables > > multiline strings? If I try this i get what's cited below. Thanks. > > > >>> d="d > > d" > > >>> d > > >

Re: assigning multi-line strings to variables

2010-04-27 Thread Brendan Abel
On Apr 27, 7:20 pm, goldtech wrote: > Hi, > > This is undoubtedly a newbie question. How doI assign variables > multiline strings? If I try this i get what's cited below. Thanks. > > >>> d="d > d" > >>> d > > Traceback (most recent call last): >   File "", line 1, in > NameError: name 'd'

Re: assigning multi-line strings to variables

2010-04-27 Thread MRAB
goldtech wrote: Hi, This is undoubtedly a newbie question. How doI assign variables multiline strings? If I try this i get what's cited below. Thanks. d="d d" d Traceback (most recent call last): File "", line 1, in NameError: name 'd' is not defined Use a triple-quoted string

assigning multi-line strings to variables

2010-04-27 Thread goldtech
Hi, This is undoubtedly a newbie question. How doI assign variables multiline strings? If I try this i get what's cited below. Thanks. >>> d="d d" >>> d Traceback (most recent call last): File "", line 1, in NameError: name 'd' is not defined -- http://mail.python.org/mailman/listinf