Syntax Error: unindent does not match any outer indentation level

482 views
Skip to first unread message

Ben VK

unread,
Feb 25, 2015, 6:27:48 PM2/25/15
to pyscr...@googlegroups.com

Hi All, 


I have been using PyScripter for a few weeks now, and I have just opened an old py script and every time I enter and add a new line the error - Syntax Error: unindent does not match any outer indentation level pops up and my script wont run.


I open the edited file in another text editor, and it shows me that PyScripter is converting tabs to spaces (represented by the dots below) when the existing python script must have had tabs throughout (represented by the long dash).


Is there a way to tell the scripter to use whatever has been used previously in the script? Or how do I actually type the code so this doesn't appear?


Thanks


2015-02-26_10-18-09_PyScripter - UUNDERDEVELOPMENT Importing_SEWER_CAD_Data.py.jpg

PyScripter

unread,
Mar 20, 2015, 8:12:49 PM3/20/15
to pyscr...@googlegroups.com
You can either use tabs or spaces for indentation, but you cannot mix them.   The recommended way is to use spaces.

PyScripter supports both modes.  This is controlled by the Editor option (Tools, Editor Options, Options) "Tabs to spaces".  When this is selected (by default), whenever your press the Tab key PyScripter inserts spaces.

There are also two tools to help you clean up your file Tabify and Untabify, under Edit, Source code.   Select all text before you invoke the commands.

Finally there is an external tool under Tools, Tools called "Check Indendation".
Reply all
Reply to author
Forward
0 new messages