#885 Indenting errors when compiling python

General (289)

Geany 1.22
Python 2.7.3

Ive set the preferences in Geany editor to make tabs into 8 spaces, as many many many sites suggest to do. (Preferences -> editor -> indentation -> [Type = Spaces] [Width = 8])

However, when I try to compile some code, I get indentation errors.

print "hello"
print "hello2"

Sorry: IndentationError: ('unexpected indent', ('pythontest.py', 2, 8, ' print "hello2"\n'))

Pics attached of config and error.


  • boardstretcher

    boardstretcher - 2012-08-29

    There is a tab worth of spaces before the second line (.......print "hello2")

    Sourceforge took out the tab spacing. Sorry

  • Colomban Wendling

    In Python every single indentation has a meaning, you can't indent a line differently from other lines in the same block. In the root scope (e.g. not inside any block) you can't indent at all.

    Also, the preferred ("official") Python indent is 4 spaces, no tabs ever.

    Ah, and you seem to speak of 2 attached image, but there is only one (the preference tab).

    And any way this is not a problem with Geany; it's either a problem with your code or Python's my_compile module (no chance).

  • Colomban Wendling

    • status: open --> pending-invalid
  • boardstretcher

    boardstretcher - 2012-08-29
    • status: pending-invalid --> closed-invalid

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks