I have a file parser.py
class Parser:
...
...
@staticmethod
def someMethod():
Parser.argsParser.someNewMethod()
And a file worker.py
import connection, parser
...
...
class Worker:
def __init__(self):
try:
parsed = parser.Parser()
And a file driver.py:
sys.path.append('./lib')
import worker, parser
parser.Parser.someMethod()
Now my directory structure is
/some/path/driver.py
/some/path/lib/worker.py
/some/path/lib/parser.py
When I run driver.py I get:
Traceback (most recent call last):
File "./lib/worker.py", line 13, in __init__
parsed = parser.Parser()
AttributeError: 'module' object has no attribute 'Parser'
'module' object has no attribute 'Parser'
However, when I copy driver.py into ./lib and run, I do not find any problems. Can anyone point me to what is going on?