The Python language has rather strict indentation rules. These rules exist because the indentation is actually part of the language syntax and is used to define blocks of code. But sometimes, maybe sometimes, you’d like to be able to indent things the way you like. An example of this is PPG layout code in XSI when said layout includes tabs and/or groups.

You can put a ; at the end of your Python statement but because it is optional, why would you? Well, combined with the \ character that allows you to wrap long lines, you can trick Python into thinking that you have many statements on a single line and thus arbitrarily indent them.

Please, use this sparingly! The Python language was designed in such a way that makes it a very legible language. Using this trick for the wrong reasons can quickly make it an unintelligible tangle.

2 Responses to “Messing around with something beautiful”

I really admire python users so much, I”ve tried so many times to use this language, but the syntax is so different from all the languages I”ve used since now.
I didnít know python allows to close lines with semi-columns, now Iím just missing the most important part for me to read the code, brackets!!! have you got any trick about this? ; )