[Tutor] outputting long lines

Gregor Lingl glingl@aon.at
Sat Mar 8 03:25:02 2003


Abel Daniel schrieb:

>What about:
>  
>
>>1  if self.__token_info == 'cw<nt<type______':
>>2              self.__write_to_foot_obj.write(\
>>3              'mi<dv<op<footnote<at<num>%s' % self.__footnote_count)
>>    
>>
In fact you can write:

1  if self.__token_info == 'cw<nt<type______':
2              self.__write_to_foot_obj.write(
3              'mi<dv<op<footnote<at<num>%s' % self.__footnote_count)

... as in Python you can break lines within any kind of brackets: (), [], {}
For example:

 >>> def f(x):
...     print x
...    
 >>> f(
...
... "a"
...
... )
a

Regards,
Gregor

P.S.:

 >>> f(
...
... "a"
...
... "b"
...
... )
ab
 >>>