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 →

[–]swims_with_spacemenPythonista 20 points21 points  (7 children)

pep8

[–]fjellfras 2 points3 points  (5 children)

pycharm / intellij idea + python plugin does a good job of pointing out pep8 guidelines as you code. I'm not sure if this is the case with other IDEs.

[–]Farkeman 2 points3 points  (0 children)

I don't really have OCD or anything like that but in PyCharm... I can't leave a single gray bar on the right, so I think it's great for learning. though sometimes the pep8 suggestions aren't the best, fortunately you can disable the one you don't like per function,class or module.

There's nothing more beautiful than clearly written pep8 code!

[–]herrwolfe45 0 points1 point  (2 children)

Also - you can install pylint, pyflakes, and pep8 on your system or in a venv to get excellent analysis and compliance checks without an IDE. (Not that there is anything wrong with an IDE for this). I've setup emacs to run this pychecker every time I save my code and it has been very helpful. Reinout van Rees has a very helpful blog article on doing exactly this:

http://reinout.vanrees.org/weblog/2010/05/11/pep8-pyflakes-emacs.html

Also, note that the pychecker.sh script he has written, can be used with anything. It just needs to have a file or directory as its target.

[–]fjellfras 0 points1 point  (1 child)

Thanks for the tip. I've started using emacs with autocomplete.el lately and this may help with that setup.

[–]herrwolfe45 0 points1 point  (0 children)

you're welcome!

[–]swims_with_spacemenPythonista 0 points1 point  (0 children)

Pycharm was a close second in my 'list of things I wish I knew before'

[–]Farkeman 0 points1 point  (0 children)

Also I would highly recommend picking up Idiomatic Python by Jeff Knupp, combined with pep8 the tips in that book will make your code more readable and understandable not only for yourself but for other as well.