This is the code that I use to access Stack Overflow:
from stackexchange import Site, StackOverflow
so = stackexchange.StackOverflow()
for q in so.questions(pagesize=50):
print q.title
It runs fine when I copy and paste it on the command shell. But running it in IDLE gives the following error:
Traceback (most recent call last):
File "C:\Users\Animesh\Desktop\NLP\metastack.py", line 3, in <module>
from stackexchange import Site, StackOverflow
File "C:\Users\Animesh\Desktop\stackexchange.py", line 4, in <module>
AttributeError: 'module' object has no attribute 'StackOverflow'
How should I correct it?
stackexchange.py
file in your local directory? Test withimport stackexchange; print
stackexchange.__file__`.