Bug or feature: double strings as one
r
rt8396 at gmail.com
Sun Aug 9 16:34:12 EDT 2009
On Aug 9, 12:10 pm, "Jan Kaliszewski" <z... at chopin.edu.pl> wrote:
..(snip)
> Sorry, you are wrong, '''-way would be usefull only if:
>
> * you want to have '\n' in each place where you wrap the
> literal in your code,
>
> and
>
> * you use '''-literal at a module (non-indented) level
>
> or you need not only '\n'-s but also indentations
> (dependent on indentation of your code),
>
> or such ugly indentation is ok for you:
>
> some indentated code...
> prompt = '''quite long string %s quite long string
> ''' quite long string quite long string %s
> ''' quite %s long string quite long string
> '''
> some indentated code...
>
> That's why I wrote it's "useless in such cases."
@ Jan & Anny
No, of course putting a multi-line string inside a block does not
solve anything. What i meant for you to do is to declare the string
outside the block or as a module level Constant. i typically declare
all multi-line strings (ig for dialog prompts etc..) right after my
globals at the top of my modules or within an imported module like...
from thisModuleConstants import *
More information about the Python-list
mailing list