Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have small problem with python console in QGIS. Normally, I write some code in text editior and then copy whole code to python console. Unfortunately, the console underlines the indentations with blue lines and I got en error: "unindent does not match any outer indentation level."

To solve it I need to copy paste tabs from lines where it is ok.

My question is: why is this problem occuring and how to solve in easier way? I need to say that copying tabs is unnecessary waste of time.

I am attaching the picture to illustrate the problem.

enter image description here

share|improve this question
    
what editor do you use? There seems to be a problem with a mix of tabs and spaces as indentations... – Andreas Müller 44 mins ago
    
I am using Notepad ++ – sweet.sugar.cola 36 mins ago
    
you may try this: force notepad++ to use spaces instead of tabs. in notepad++ go to Settings, Tab Settings and click the option "Replace by space". For existing files with tabs, use search and replace to vonvert tabs into spaces (normally four spaces are used for one indentation level) – Andreas Müller 31 mins ago
    
When I do it I notice that python console have problems exactly in this places where there are spaces instead of tabs. Anyway, if I am trying to remove spaces and put tab as a indentation in notepad++ it is still creating four spaces. – sweet.sugar.cola 26 mins ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.