3 ms·
Yes, indentation is done just with spaces. Tabs are not used. Typically you set your text editor to have the tab key print 4 spaces.
by sam 15y ago
Yes, indentation is done just with spaces. Tabs are not used. Typically you set your text editor to have the tab key print 4 spaces.
- kmfrk 15y agoAh, there lies the rub. Thanks a bunch.
- xtacy 15y agoEDIT: Emacs is pretty intelligent when it comes to indenting Python code; it does not merely insert 4 spaces for a TAB, but it automatically aligns your code to the Python expression in your previous line! I don't know which one is the "right" way, but I certainly prefer Emacs's default behaviour. Maybe I just didn't configure my Vim properly :-) Example: In Emacs: def _five(one,two, ....,,,,..three,four): In Vim, with 4 space Tabs: def _five(one,two, ....,,,,|hree,four): | => cursor position when you press ENTER.