Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Expert Python Programming

You're reading from   Expert Python Programming Write professional, efficient and maintainable code in Python

Arrow left icon
Product type Paperback
Published in May 2016
Publisher Packt
ISBN-13 9781785886850
Length 536 pages
Edition 2nd Edition
Languages
Arrow right icon
Toc

Table of Contents (21) Chapters Close

Expert Python Programming Second Edition
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
1. Current Status of Python FREE CHAPTER 2. Syntax Best Practices – below the Class Level 3. Syntax Best Practices – above the Class Level 4. Choosing Good Names 5. Writing a Package 6. Deploying Code 7. Python Extensions in Other Languages 8. Managing Code 9. Documenting Your Project 10. Test-Driven Development 11. Optimization – General Principles and Profiling Techniques 12. Optimization – Some Powerful Techniques 13. Concurrency 14. Useful Design Patterns Index

Useful tools


Part of the previous conventions and practices can be controlled and worked out with the following tools:

  • Pylint: This is a very flexible source code analyzer

  • pep8 and flake8: These are a small code style checker, and a wrapper that adds to it some more useful features, like static analysis and complexity measurement

Pylint

Besides some quality assurance metrics, Pylint allows you to check whether a given source code is following a naming convention. Its default settings correspond to PEP 8, and a Pylint script provides a shell report output.

To install Pylint, you can use pip:

$ pip install pylint

After this step, the command is available and can be run against a module, or several modules, using wildcards. Let's try it on Buildout's bootstrap.py script:

$ wget -O bootstrap.py https://bootstrap.pypa.io/bootstrap-buildout.py -q
$ pylint bootstrap.py
No config file found, using default configuration
************* Module bootstrap
C: 76, 0: Unnecessary parens after 'print' keyword...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images