pycharm convert tabs to spaces automatically
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.
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.
This only converts the tabs without changing anything else:
Edit -> Convert Indents -> To Spaces