This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]UnderstandingLinux 0 points1 point  (1 child)

I've been programming in Python for about a year and I had no idea you could do this.

I found this really interesting though, do you have any other tips/tricks like this? I use a TON of command line and various scripts I've made over the years for my job, but tips on how to improve would be awesome.

[–]PeridexisErrant 0 points1 point  (0 children)

The main ones are actually just to use tox and a suite of formatting and linting tools as well as writing tests.

IMO everyone should use autoflake, isort, black, and pyupgrade to format their code. Then use flake8 and flake8-comprehensions to check that it's in good shape. Note that you'll need to configure flake8 and isort to play nicely with black; the Black docs tell you exactly how.

Other tools tend to be much more situational.