2

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!

2 Answers2

1

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.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
0

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()
Decosta
  • 15
  • 4