Modules

Modules are regular Python .py files that define functions or classes that may be imported and reused in other Python programs.

functions.py:

"""This module contains functions that will be imported and reused."""

def function1():
    """Function1"""
    print("In function1")

classes.py:

"""This module contains classes that will be imported and reused."""

class Class1(object):
    """Class1"""

    def method1(self):
        """method1"""
        print("In method1")

results matching ""

    No results matching ""