I am trying to call a module with mod = importlib.import_module(str)
from Sample2.py
and the module which
I am calling is PlayAround_Play.py
it is working fine when it contains only a function . If I included a class to that function
It is not working fine. Getting error as TypeError: this constructor takes no arguments
code in sample2.py
import importlib
def calling():
str="PlayAround_Play"
a=10
b=20
c=30
mod = importlib.import_module(str)
getattr(mod,str)(a, b, c)
calling()
code in PlayAround_Play.py
class PlayAround_Play():
def PlayAround_Play(self, a, b, c):
d=a+b+c
print d
can u guys show me a solution how to call that class by using importlib