Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The method for utilizing the display feature to print the module this particular module is binding from is by using the name attribute. This attribute returns the name of the module as a string. Therefore, adding the following line of code will print the module name:

print(__name__)

This line of code should be included in the module where you want to print the module it is binding from. When this module is imported by another module, the name of the importing module will be printed.