python - can't workout why getting a type error on __init__ -
hope can me...
have following:
smartsheet_test.py
from pfcms.content import content def main(): ss = content() ss.smartsheet() if __name__ == "__main__": main()
content.py
import smartsheet ss class content: """ pfcms smartsheet utilities """ def __init__(self): self.token = 'xxxxxxxxxxxxxxxxxxx' def smartsheet(self): smartsheet = ss.smartsheet(self.token)
however when execute code get:
python -d smartsheet_test.py traceback (most recent call last): file "smartsheet_test.py", line 8, in <module> main() file "smartsheet_test.py", line 5, in main ss.smartsheet() file "/xxxxx/pfcms/pfcms/content.py", line 10, in smartsheet smartsheet = ss.smartsheet(self.token) typeerror: __init__() takes 1 argument (2 given)
is self
being passed ss.smartsheet(self.token)
somehow, can see i'm passing argument self.token
. knowledge of python isn't deep @ point. appreciated.
thanks alex
you have (or had) file called smartsheet.py
in current working directory. delete or rename file, , delete related .pyc
file.
Comments
Post a Comment