Force an indent in Python code for organizational purposes

Posted by Vine on Stack Overflow See other posts from Stack Overflow or by Vine
Published on 2011-12-10T15:26:24Z Indexed on 2012/07/05 21:16 UTC
Read the original article Hit count: 513

Filed under:
|

Is there a way to force an indent in Python? I kind of want it for the sake of making the code look organized. As an example:

# How it looks now
class Bro:
    def __init__(self):
        self.head = 1
        self.head.eye = 2
        self.head.nose = 1
        self.head.mouth = 1
        self.neck = 1
        self.torso = 1

# How it'd look ideally (indenting sub-variables of 'head')
class Bro:
    def __init__(self):
        self.head = 1
            self.head.eye = 2
            self.head.nose = 1
            self.head.mouth = 1
        self.neck = 1
        self.torso = 1

I imagine this is possible with some sort of workaround, yeah?

© Stack Overflow or respective owner

Related posts about python

Related posts about indent