user3333824
user3333824

Reputation: 23

Expected an indented block after Importing?

Today I was coding and i ran into this unusual error. Here is my code:

from direct.showbase.ShowBase import ShowBase
import cogManager

class application(ShowBase):

    def __init__(self):
        ShowBase.__init__(self)

playApplication = application()
playApplication.run()

Error:

Traceback (most recent call last):
  File "CogCreator.py", line 2, in <module>
  import cogManager
File "C:\Users\GeekyGamerGavin\Documents\Toontown Phase Files\NEW\cogManager.p
y", line 4

                    ^
IndentationError: expected an indented block

But the code works when I remove

import cogManager

Could I have some help? I'm confused!

EDIT: I dont have spaces / tabs mixed!

EDIT: Fixed it. Thanks!

Upvotes: 2

Views: 2531

Answers (2)

MattDMo
MattDMo

Reputation: 102922

You probably have a tab on an empty line, or are mixing tabs and spaces. Following PEP8 coding standards, indentation should be 4 spaces per level.

Upvotes: 1

Decosta
Decosta

Reputation: 15

Try indenting def init(self):

from direct.showbase.ShowBase import ShowBase
import cogManager

class application(ShowBase):

    def __init__(self):
        ShowBase.__init__(self)

playApplication = application()
playApplication.run()

Upvotes: 0

Related Questions