Novice Problem: Indentation

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
jwka
Posts: 24
Joined: Sun Nov 28, 2010 8:45 pm

Novice Problem: Indentation

Post by jwka » Wed Dec 01, 2010 5:01 pm

With this code:

Code: Select all

print '...BattInfo: 1=', sps.ACLineStatus, 
        " |2=", sps.BatteryFlag,
        " |3=", sps.BatteryLifePercent,
        " |4=", sps.BatteryLifeTime,
        " |5=", sps.BatteryFullLifeTime
I get the error:

17:59:58 Error compiling script.
17:59:58 Traceback (most recent call last):
17:59:58 IndentationError: unexpected indent (58, line 16)
17:59:58 Error compiling script.
17:59:58 Traceback (most recent call last):
17:59:58 IndentationError: unexpected indent (59, line 14)

where line 14 is the line following the print statement.

I get the error with 4 & 8 blanks as well as with tabs. What do I do wrong?

Thanks so much
jwka

User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Novice Problem: Indentation

Post by Pako » Wed Dec 01, 2010 5:08 pm

Code: Select all

print '...BattInfo: 1=', sps.ACLineStatus,\
    " |2=", sps.BatteryFlag,\
    " |3=", sps.BatteryLifePercent,\
    " |4=", sps.BatteryLifeTime,\
    " |5=", sps.BatteryFullLifeTime
Pako

jwka
Posts: 24
Joined: Sun Nov 28, 2010 8:45 pm

Re: Novice Problem: Indentation

Post by jwka » Wed Dec 01, 2010 5:23 pm

thanks so much! Some things become easy as soon as you get told ...

jwka

Post Reply