Posted on 10th September 2024| views
Assume there is your file called MY_file which contains a class called mindmajix something like this
class mindmajix:
def __init__(self,val):
self.val=val
def getVal(self):
return self.val
Now to import a class called mindmajix to your program you can do this
sys.path.append(".")
from my_file import mindmajix
newClass = myClass(10)
val = newClass.getVal()
Output:
10