IndentationError: unexpected indent

This is the location for all mods to collaborate. Anyone making or planning their own mod should post help requests, screen shots and news here.

Moderators: Omega, tillias, Mod Contributor

Post Reply
legine
Bounty Hunter
Bounty Hunter
Posts: 139
Joined: Mon Sep 27, 2004 8:40 am
Location: Germany
Contact:

IndentationError: unexpected indent

Post by legine »

What does that mean?
  • File "<string>", line 2
    from privateer import privateer
    ^
    IndentationError: unexpected indent
I made a mission after whats written in:
http://vegastrike.sourceforge.net/media ... ntegration

It looks like this:
  • <mission>
    <settings>
    <origin planet="earth" x="0000" y="100" z="000.0"/>
    </settings>

    <variables>
    <var name="credits" value="13500"/>
    <var name="defaultplayer" value="blue"/>
    <var name="mission_name" value="Vega Strike Main Menu" />
    <var name="difficulty" value=".25"/><!--good starting difficulty here-->
    <var name="system" value="Special/Empty" />
    <var name="description" value="Welcome to Vega Strike: Upon the Cold Sea." />
    <var name="savegame" value="main_menu" />
    </variables>

    <flightgroups>
    <!-- need at least one, to avoid messing with the engine -->
    <flightgroup name="Shlimazel" faction="privateer" type="dumbfire" ainame="default" waves="1" nr_ships="1">
    <pos x="119990000000" y="-9000000" z="-109990000000.0"/>
    </flightgroup>
    </flightgroups>

    <python>
    from privateer import privateer
    my_obj=privateer(8000,40000,500,3,2,.6,.25,.1,400000,2000)
    </python>

    </mission>
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: IndentationError: unexpected indent

Post by loki1950 »

It may be referring to a Python error as it can be very picky about indentations.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
ace123
Lead Network Developer
Lead Network Developer
Posts: 2560
Joined: Sun Jan 12, 2003 9:13 am
Location: Palo Alto CA
Contact:

Re: IndentationError: unexpected indent

Post by ace123 »

Sorry, the XML parser doesn't strip leading spaces from python lines, even if it makes sense to.

In your case, you just need to make sure all python code is at the beginning of the line, like this:

Code: Select all

    </flightgroups>
	
	<python>
from privateer import privateer
my_obj=privateer(8000,40000,500,3,2,.6,.25,.1,400000,2000)
	</python>

</mission>
legine
Bounty Hunter
Bounty Hunter
Posts: 139
Joined: Mon Sep 27, 2004 8:40 am
Location: Germany
Contact:

Re: IndentationError: unexpected indent

Post by legine »

Hmm, cant edit the Wiki. Can someone change this? --> http://vegastrike.sourceforge.net/media ... ntegration

Thanks the Info. I never had that Problem :)
MC707
Venturer
Venturer
Posts: 555
Joined: Sun Jan 18, 2009 5:18 am
Location: Quito, Ecuador.
Contact:

Re: IndentationError: unexpected indent

Post by MC707 »

legine wrote:Hmm, cant edit the Wiki.
You should be able to edit the wiki. Have you tried logging in?
My Machine: OS: Ubuntu 8.10 (intrepid) 64 bit in a 500GB Maxtor HD @ 7200 RPM, Windows Vista PsyChoses Edition 2009 32 bit in a 500GB Samsung HD @ 7200 RPM CPU: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz GPU: nVidia GeForce 9400 GT @ 1024 MB RAM: 3891 MB
Earthlings|The End of the Internet?|FreeWebsite
legine
Bounty Hunter
Bounty Hunter
Posts: 139
Joined: Mon Sep 27, 2004 8:40 am
Location: Germany
Contact:

Re: IndentationError: unexpected indent

Post by legine »

yes, I thought first I us the wrong password but checked today again with same result. I try changeing my password to a soft one.

EDIT:
Okay seems that there is a Problem with special character between phpbb and Wiki. :evil:
MC707
Venturer
Venturer
Posts: 555
Joined: Sun Jan 18, 2009 5:18 am
Location: Quito, Ecuador.
Contact:

Re: IndentationError: unexpected indent

Post by MC707 »

nice. it is always good to have people updating the wiki, which becomes older and older as time goes by. :(
My Machine: OS: Ubuntu 8.10 (intrepid) 64 bit in a 500GB Maxtor HD @ 7200 RPM, Windows Vista PsyChoses Edition 2009 32 bit in a 500GB Samsung HD @ 7200 RPM CPU: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz GPU: nVidia GeForce 9400 GT @ 1024 MB RAM: 3891 MB
Earthlings|The End of the Internet?|FreeWebsite
legine
Bounty Hunter
Bounty Hunter
Posts: 139
Joined: Mon Sep 27, 2004 8:40 am
Location: Germany
Contact:

Re: IndentationError: unexpected indent

Post by legine »

Honestly ace was faster and put a sentence in...
MC707
Venturer
Venturer
Posts: 555
Joined: Sun Jan 18, 2009 5:18 am
Location: Quito, Ecuador.
Contact:

Re: IndentationError: unexpected indent

Post by MC707 »

legine wrote:Honestly ace was faster and put a sentence in...
Hehehe. Still, you can check for other outdated junk, report it (I think, correct me if I'm wrong) and update it.
My Machine: OS: Ubuntu 8.10 (intrepid) 64 bit in a 500GB Maxtor HD @ 7200 RPM, Windows Vista PsyChoses Edition 2009 32 bit in a 500GB Samsung HD @ 7200 RPM CPU: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz GPU: nVidia GeForce 9400 GT @ 1024 MB RAM: 3891 MB
Earthlings|The End of the Internet?|FreeWebsite
legine
Bounty Hunter
Bounty Hunter
Posts: 139
Joined: Mon Sep 27, 2004 8:40 am
Location: Germany
Contact:

Re: IndentationError: unexpected indent

Post by legine »

Yea, working as a consultant I value documentation... ;)
Post Reply