Page 1 of 1

Novice Problem: Indentation

Posted: Wed Dec 01, 2010 5:01 pm
by jwka
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

Re: Novice Problem: Indentation

Posted: Wed Dec 01, 2010 5:08 pm
by Pako

Code: Select all

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

Re: Novice Problem: Indentation

Posted: Wed Dec 01, 2010 5:23 pm
by jwka
thanks so much! Some things become easy as soon as you get told ...

jwka