Tab not working properly in Python

I am using NotePAD ++ to edit Python scripts. I recently downloaded the PyDEV IDE (for Eclipse). The problem is that when I wrote scripts in NotePad ++, I used “TAB” for indentation, and now when I open them with PyDEV, every time I try to write a new line instead of “TABS”, PyDEV inserts spaces . (even if I press the "TAB" key, Eclipse inserts 4 spaces instead of a single tab). This causes an indent error.

Is there any way to fix this thing?

Thank!

+3
source share
3 answers

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

Use 4 spaces per indentation level.

Notepad ++ .

Eclipse .

+7

- , (, C) (Python). . , .

, , , , . .

Eclipse PyDev - Source⇒Convert .

+4

Set aside tabs vs spaces.

To fix this, you need to select 'toggle force tabs' in the settings for eclipse to use tabs instead of the default spaces.

+1
source

Source: https://habr.com/ru/post/1735391/


All Articles