Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I replace four spaces by one tab in a big python codebase?

I have downloaded a python code and would like to edit it. The problem is that I used to use tabs to make indents but file use four spaces instead and if a combination of spaces and tabs is used, visually it looks fine, but the code generate errors.

My question is if there is a simple way to replace spaces by tabs?

like image 456
Roman Avatar asked Oct 25 '25 10:10

Roman


1 Answers

get an editor that understands simulated tabs. then it will simulate tabs using 4 spaces. Most editors can do this nowadays. They feel just like tabs but are spaces..

like image 167
Markus Mikkolainen Avatar answered Oct 27 '25 01:10

Markus Mikkolainen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!