K
Kevin Holleran
Hello,
I have a class called My_Class in a subdir called Sub_Dir.
in My_Class.py is the following
class My_Class_Connector:
def __init__(self,un,pw,qs_srv="domain.com"):
self.username = un
self.password = pw
....
Then I am trying to call from a script in the parent dir like this:
from Sub_Dir.My_Class import *
q_api = My_Class.My_Class_Connector(string1,string2)
I have not worked much with Python classes so I am not sure what I am doing
wrong. When running this from my script, I get the following error:
Traceback (most recent call last):
File "testing.py", line 1, in <module>
from Sub_Dir.My_Class import *
ImportError: No module named Sub_Dir.My_Class
I have played around a bit with the calls (removing the My_Class in the
q_api assignment to instantiate the object, etc).
Thanks for any help.
Kevin
I have a class called My_Class in a subdir called Sub_Dir.
in My_Class.py is the following
class My_Class_Connector:
def __init__(self,un,pw,qs_srv="domain.com"):
self.username = un
self.password = pw
....
Then I am trying to call from a script in the parent dir like this:
from Sub_Dir.My_Class import *
q_api = My_Class.My_Class_Connector(string1,string2)
I have not worked much with Python classes so I am not sure what I am doing
wrong. When running this from my script, I get the following error:
Traceback (most recent call last):
File "testing.py", line 1, in <module>
from Sub_Dir.My_Class import *
ImportError: No module named Sub_Dir.My_Class
I have played around a bit with the calls (removing the My_Class in the
q_api assignment to instantiate the object, etc).
Thanks for any help.
Kevin