Alex Rivera | Logout

PyCharm convert tabs to spaces automatically

Asked 2012-08-05T11:49:35.793
144

I am using PyCharm IDE for Python development. It works perfectly fine for Django code, so I suspected that converting tabs to spaces is the default behaviour. However, the IDE is giving errors everywhere because it can't convert tabs to spaces automatically. Is there a way to achieve this?

Edit
Report

1 Answer

142

Change the code style to use spaces instead of tabs:

spaces

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

answered 2012-08-05T11:58:41.350

Your Answer