pycharm convert tabs to spaces automatically

匿名 (未验证) 提交于 2019-12-03 02:18:01

问题:

I am using pycharm IDE for python development it works perfectly fine for django code so suspected that converting tabs to spaces is default behaviour, however in python IDE is giving errors everywhere because it can't convert tabs to spaces automatically is there a way to achieve this.

回答1:

Change the code style to use spaces instead of tabs:

Then select a folder you want to convert in the Project View and use Code | Reformat Code.



回答2:

For selections, you can also convert the selection using the "To spaces" function. I usually just use it via the ctrl-shift-A then find "To Spaces" from there.



回答3:

This only converts the tabs without changing anything else:

Edit -> Convert Indents -> To Spaces 


回答4:

ctrl + shift + A => open pop window to select options, select to spaces to convert all tabs as space, or to tab to convert as tab.



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!