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

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 triple quoted

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. Steinbachal...@start.no 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

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. Steinbachal...@start.no wrote: On 28.04.2010 18:54, * Lie Ryan: Python have triple-quoted string when you want to include large amount of text;

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. Steinbachal...@start.no wrote: On 28.04.2010 18:54, * Lie Ryan: Python have triple-quoted string when you

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. Steinbachal...@start.nowrote: On 28.04.2010 18:54, * Lie Ryan: Python

Re: assigning multi-line strings to variables

2010-04-30 Thread Neil Cerutti
On 2010-04-30, Lie Ryan lie.1...@gmail.com 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

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 lie.1...@gmail.com 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

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 string to

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 breaks I

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

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 Ryanlie.1...@gmail.com 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

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 various escapes for quotes

Re: assigning multi-line strings to variables

2010-04-29 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). No, the implicit

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

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. --

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 writing a

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 indentation and

Re: assigning multi-line strings to variables

2010-04-29 Thread Carl Banks
On Apr 28, 11:16 am, Alf P. Steinbach al...@start.no 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

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. Steinbachal...@start.no 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

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. I don't agree.

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, goldtechgoldt...@worldpost.com 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):

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 goldtechgoldt...@worldpost.com wrote in message news:4e25733e-eafa-477b-a84d-a64d139f7...@u34g2000yqu.googlegroups.com... On Apr 27, 7:31

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 goldtechgoldt...@worldpost.com wrote in message

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 it, and

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 quoted

Re: assigning multi-line strings to variables

2010-04-28 Thread Ben Finney
Lie Ryan lie.1...@gmail.com 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

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

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 interactive input, line 1, in module NameError: name 'd' is not defined --

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 interactive input, line 1, in module NameError: name 'd' is not defined Use a

Re: assigning multi-line strings to variables

2010-04-27 Thread Brendan Abel
On Apr 27, 7:20 pm, goldtech goldt...@worldpost.com 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 interactive input, line 1, in

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 goldt...@worldpost.com 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 goldtech
On Apr 27, 7:33 pm, MRAB pyt...@mrabarnett.plus.com 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 interactive

Re: assigning multi-line strings to variables

2010-04-27 Thread Benjamin Kaplan
On Tue, Apr 27, 2010 at 10:51 PM, goldtech goldt...@worldpost.com wrote: On Apr 27, 7:33 pm, MRAB pyt...@mrabarnett.plus.com 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.

Re: assigning multi-line strings to variables

2010-04-27 Thread geremy condra
On Tue, Apr 27, 2010 at 10:51 PM, goldtech goldt...@worldpost.com wrote: On Apr 27, 7:33 pm, MRAB pyt...@mrabarnett.plus.com 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.

Re: assigning multi-line strings to variables

2010-04-27 Thread MRAB
goldtech wrote: On Apr 27, 7:33 pm, MRAB pyt...@mrabarnett.plus.com 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

Re: assigning multi-line strings to variables

2010-04-27 Thread Ben Finney
goldtech goldt...@worldpost.com 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

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 goldt...@worldpost.com 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

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 goldtechgoldt...@worldpost.com wrote in message news:4e25733e-eafa-477b-a84d-a64d139f7...@u34g2000yqu.googlegroups.com... On Apr 27, 7:31 pm, Brendan Abel007bren...@gmail.com wrote: On