课程: Programming Concepts for Python

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Modules

Modules

- There's a common saying that "A smart programmer is a lazy programmer," and what that means is clever programmers don't waste time rewriting routines that already exist. There's no need to reinvent the wheel if it's already been invented for you. Almost all programming languages come with a standard library of code for accomplishing common programming tasks, and you should learn how to use the existing libraries because it'll save you a lot of time. Built-in functions we might use to write our program are organized within modules and packages, just like the tools in my garage. One of my brake lights is out, and in order to fix the problem, I'm going to need the right tools for the job. I keep different types of tools organized into different toolboxes. This toolbox holds my screwdrivers, while this one holds my wrenches. I need to perform the function of replacing my taillight, so I'll grab the modules I need…

内容