Why modularizing is a good idea

Why doesn't Python automatically import all of its built-in modules? First of all, importing all of its modules would take a LOOOONG time. Second, if it did, there would be thousands of names stored in the namespace, and you wouldn't be able to give those names to your own data—or if you did use them, you might get unexpected results. Because you need to import modules, stuff you don't use stays out of your way, like storing your winter clothes in the attic until October.

Whoa! That's a lot of modules. But don't worry. You can drive a car without knowing exactly how everything under the hood works, and the same goes for working with Python. Python For Dummies explains the workings of many of Python's modules and shows you where to go to discover more about the rest.

Tip The list of modules differs depending on your version of Python, your operating system, and the third-party modules that may have been installed for Python.

Was this article helpful?

0 0

Post a comment