Possible Duplicate:
Unable to instantiate a class defined in a subdirectory
I have:
test.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import WykopLinks
import WykopAPI
API = WykopAPI.WykopAPI('apikey')
Links = WykopLinks.WykopLinks(API)
List = Links.getPromoted();
for Znalezisko in List:
print Znalezisko.id
print Znalezisko.title
I tried to change the import to from WykopLinks import WykopLinks or change name on other name but this did not help.
Also I’m trying other-name-formodule.WykopLinks(API)
Error:
Links = WykopLinks(API)
TypeError: 'module' object is not callable
I checked other problems described here, but none of them helps.
This code
fails just as the error message describes:
WykopLinksis a module and is not callable.Presumably you should be calling some function or class defined in the
WykopLinksmodule. But since I can’t find any documentation for that module, and since you didn’t give any information, I can’t tell you what the code should look like.