Alternatively, the modules can be imported by the command import. This creates a namespace named after the filename. The command from puts the functions into the general namespace without creating a separate namespace:
import smartfunctions print(smartfunctions.f(2)) # 5 from smartfunctions import g #import just this function print(g(1)) # 0 from smartfunctions import * #import all print(h(2)*f(2)) # 1.0
Import the commands import and from. Import the functions only once into the respective namespace. Changing the functions after the import has no effect on the current Python session.