split long string in two code lines
Tracubik
affdfsdfdsfsd at b.com
Mon Jun 13 17:31:29 EDT 2011
Hi all,
newbie question here
how can i write code like this:
1 def foo():
2 for index in ...
3 for plsdoit in ...
4 print "this is a very long string that i'm going to write 5
here, it'll be for sure longer than 80 columns"
the only way i've found is to use the "/", but than i've to write
something like this:
1 def foo():
2 for index in ...
3 for plsdoit in ...
4 print "this is a very long string that i'm going to/
5 write here, it'll be for sure longer than 80 columns"
what i don't really like is that line 5 is not indented. if i indent it,
the spaces will be counted as spaces of the string.
Is there a better way to split the string?
thanks for your kind help
Nico
More information about the Python-list
mailing list