Apr-01-2017, 02:44 PM
from tkinter import * import random class ExamGuru: def _init_(self, parent): self.parent=parent self.index=0 self.question_num=1 self.score=0 self.questions=[Question("First Insurance Company In India ? ", "Oreintal Life Insurance",["Bombay Mutual Insurance","Western India Insurance","LIC"]), Question("Which Of The Following Risks Are Insurable ?", "Financial Risk",["Non Financial","Both","None"])] self.mainquestionframe= Frame(parent, bg="orange", width=800, height=500) self.mainquestionframe.pack_propagate(0) self.mainquestionframe.pack(pady=5) self.headingframe= Frame(self.mainquestionframe, bg="blue",Width=800, height=40) self.headingframe.pack_propagate() self.headingframe.pack(pady=5) class Question: def _init_(self,question,answer,dummies): self.question=question self.answer=answer self.dummies=dummies self.set_answers() def set_answers(self): self.answers=self.dummies self.answer.insert(random.randrange(len(self.dummies)+1), self.answer) if __name__=='__main__': root=Tk() root.title("Exam Guru") root.mainloop()not getting any anything on the tkinter window
system- ubuntu 14.04
python version - 3.4.3