In some code I’m looking at there is the following statement:
from math import exp, sqrt, ceil
however there is no folder called math in the project folder and no modules named exp, sqrt, and ceil. My question is basically where are these modules being imported from and how do I see them and other files like them? Thanks in advance.
You have some confused terminology. In this case,
mathis the module, andexp, sqrt, ceilare functions it defines. Usually it isfrom <module> import <function/class>.mathis a base module which is included with every Python installation. Python has set of specific places it will look for the module. In this case,mathwill be a dynamically loaded module written in C.You can find out where it comes from by doing:
Note that this will give an error for anything that is inbuilt into the interpreter, however.