I have a function definition that needs to be passed a lot of parameters and the header is long enough that I have to scroll the horizontal bar to see the entire header.
Example:
def lines(title = "Title",xlab = "Abscissa",ylab = "Ordinate",show = True,leg = None,a,b,datos_x,datos_y,datos_z,longitud_x,longitud_y,longitud_z,*x,*L):
Is there a way to add a line break to the header so that it displays on multiple lines like the example below?
def lines(title = "Title",xlab = "Abscissa",ylab = "Ordinate",show = True,leg = None,
a,b,datos_x,datos_y,datos_z,longitud_x,longitud_y,longitud_z,*x,*L):
No problem
Moreover, it is a good style rule that the code should not be more than 72-79 characters wide...
Max Line Size – Limits all lines to a maximum of 79 characters.
There are still many devices out there that are limited to 80 characters per line; Furthermore, by limiting the width of the windows to 80 characters, you make it possible to have several windows side by side.
The default line wrap on this type of device does not give good results.
Therefore, please limit all lines to a maximum of 79 characters. For long text strings (documentation strings or comments), it is advisable to limit the width to 72 characters.
The preferred way to split long lines is to use the Python feature of implicitly continuing lines within parentheses, brackets, and curly braces .
If necessary, you can add an extra pair of parentheses around an expression, but sometimes it's better to use a backslash instead.
Make sure you indent the following line correctly.
Examples:
The escape character for a line break is \n which is what you would have to concatenate to your string to get the break.
In one line:
In two lines:
either
http://docs.python.org.ar/tutorial/2/introduction.html#strings-of-characters