datacamp-logo

Python modules and packages

You are familiar with Python scripts that can be executed by running python <script-file>.py. Each of these files has one or more import statements to re-use Python source code written by other developers. These re-usable Python source files are referred to as modules. They are .py Python source files, like the scripts you have been writing, that are stored in a location where the import statement can find them.

There is no overtly recognizable difference between Python modules and scripts, except that developers of the former write them with the intention that their contents are imported, rather than executed by users.

In this chapter you'll learn how to turn your Python scripts into importable modules, collect those modules into packages and create Conda packages that can be easily installed by other users.


Which of the following is true about Python modules?

Answer the question
50 XP
Possible Answers
  • press
  • press
  • press
  • press