Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

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 »

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 »

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 »

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

jwka
Post Reply