How to Solve NameError: name 'function2' is not defined -- otherPyFileName
Solution: Import the 'function2' module
To Solve the error, add the following line to the top of your code.
from otherPyFileName import function2
For more information:
Python otherPyFileName function2