Here is my example.py file:
from myimport import *
def main():
myimport2 = myimport(10)
myimport2.myExample()
if _name_ == "__main__":
main()
And here is myimport.py file:
class myClass:
def __init__(self, number):
self.number = number
def myExample(self):
result = myExample2(self.number) - self.number
print(result)
def myExample2(num):
return num*num
When I run example.py file, I have the following error:
NameError: global name 'myExample2' is not defined
How can I fix that?