After pip installing, in python I can import this module if I start terminal interactively , but I get an error:
ImportError: cannot import name HN
if I save everything in a .py file and run it from the commandline. Why is this and how can I solve it?
Thanks.
Code:
from hn import HN
hn = HN()
# print the first 2 pages of newest stories
for story in hn.get_stories(story_type='newest', page_limit=2):
print story.rank, story.title