I some times get a bit self-conscious about how my code looks and spend sometime making it pretty.
So, when going through a codebase that is not PEP8 compliant I open a terminal with and run:
Then use that as a todo list to refactor the code into concordance. As I save the changes this is automatically update.
As most people, I use the find and replace tool to help me fix issues that occur multiple times. e.g.:
Here are some of the regular expression I use:
Tabs for spaces
I tend to forget spaces between parameters when these are few and small integers. So this will match commas and colons that are not followed by a space, add the space and move on.
For readability I sometimes over do with spaces between enclosing parenthesis and brackets. This one looks for parenthesis and their cousins both opening and closing, and removes following or preceding spaces.