views:

132

answers:

3

Hi,

I'm coding in Python and I really like notepad++. However, off late when I use tab to indent, it seems fine in notepad++, but when I run the program I get an indentation error, and when I check my code in emacs or something, I find that notepad++ actually adds more tab spaces than it shows on screen. Would anyone have any idea whats happening?

Thanks in advance.

+2  A: 

I would suggest going to View > Show Symbol > Show Whitespace and Tab to get an better idea of how your indentations look.

townsean
Thanks townsean. Thats really useful :)
iman453
+7  A: 

There is no universal tab size, so I always make sure to replace tabs by spaces (so you know what you see is what you get everywhere else as well)

Go to Preferences -> Language Menu/Tab Settings and check 'Replace by space'

SC Ghost
oh yeah, I forgot to mention that too. One too many times I've got bitten by using the tab. :)
townsean
Oh, sweet..didn't know that was possible. Thanks!
iman453
+1 This is exactly what I do before I spend serious development time on any IDE.
danyim
+2  A: 

PEP 8 tells us to use spaces instead of tabs in Python for cross-editor compatibility and consistency:

http://www.python.org/dev/peps/pep-0008/

Have a look at this answer for how to change tabs to spaces in Notepad++

http://stackoverflow.com/questions/455037/notepad-tabs-to-spaces

Perhaps that will fix your problem

rmx