- Python Shortcuts, Commands, and Packages
- 4.2 Twenty-Two Programming Shortcuts
- 4.3 Running Python from the Command Line
- 4.4 Writing and Using Doc Strings
- 4.5 Importing Packages
- 4.6 A Guided Tour of Python Packages
- 4.7 Functions as First-Class Objects
- 4.8 Variable-Length Argument Lists
- 4.9 Decorators and Function Profilers
- 4.10 Generators
- 4.11 Accessing Command-Line Arguments
- Chapter 4 Summary
- Chapter 4 Questions for Review
- Chapter 4 Suggested Problems
Twenty-two Python programming shortcuts and time-saving techniques.
Save 35% off the list price* of the related book or multi-format eBook (EPUB + MOBI + PDF) with discount code ARTICLE.
* See informit.com/terms
Master crafters need many things, but, above all, they need to master the tools of the profession. This chapter introduces tools that, even if you’re a fairly experienced Python programmer, you may not have yet learned. These tools will make you more productive as well as increase the efficiency of your programs.
So get ready to learn some new tips and tricks.
Shortcuts, Commands, and Packages
Python is unusually gifted with shortcuts and time-saving programming techniques. This chapter begins with a discussion of twenty-two of these techniques.
Another thing you can do to speed up certain programs is to take advantage of the many packages that are available with Python. Some of these—such as re (regular expressions), system, random, and math—come with the standard Python download, and all you have to do is to include an import statement. Other packages can be downloaded quite easily with the right tools.