diff --git a/quiz.py b/quiz.py index 506d6e4..81c34fe 100644 --- a/quiz.py +++ b/quiz.py @@ -1,7 +1,7 @@ +#!/usr/bin/env python ## -*- coding: utf-8 -*- -import sys -if sys.version_info[0] < 3: - raise RuntimeError("Python 3 required.") +from __future__ import unicode_literals, print_function +from io import open class Question: @@ -168,11 +168,13 @@ class QuestionBank: return questions +# A crappy test. if __name__ == '__main__': - qb = QuestionBank('/home/johnno/questions.doctorlard.en') + qb = QuestionBank('questions.doctorlard.en') for q in qb.questions: print(q.question) - a = input('A: ') + a = unicode(raw_input('A: '), 'utf8') + #a = input('A: ') # Python 3 if a.lower() == q.answer.lower(): print("Correct!") else: