I'm trying to obtain the questions present in StackOverflow for a
particular tag.

Whenever I try to run the program i get this *error:*

Message File Name Line Position
Traceback
    <module> C:\Users\Aaron\Desktop\question.py 20
UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in
position 34: ordinal not in range(128)


*This is the code:*
import stackexchange
import sys
sys.path.append('.')
so = stackexchange.Site(stackexchange.StackOverflow)
term= raw_input("Enter the keyword")
print 'Searching for %s...' % term,
sys.stdout.flush()
qs = so.search(intitle=term)

for q in qs:
   print '%8d %s' % (q.id, q.title)
   with open('D:\ques.txt', 'a+') as question:
       question.write(q.title)

Can anyone explain me what is going wrong here? This program used to run
perfectly fine before. Only since yesterday I have started getting this
error.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to