python - Shuffling list of widgets? Tkinter -


finally have finished damn thing! except 1 issue.

i have program quiz program created tkinter grabs dictionary list inside json file. appears working fine, except shuffling of list of buttons remain in same order (for example, if answer button in far right side of frame each consecutive questions answer in far right side).

now each time clickcorrect runs, runs loadquestion configures dictionary values 4 buttons appended list(buttonlist). shuffle list , pack buttons index (i assume because shuffled each time program loops each button have different index , shuffling order of buttons) still remain in same order. packing of buttons causing this? or random.shuffle() in wrong position??

essentially asking if packing values(buttons) list negating random.shuffle() method?

you should shuffle button list after you've created (where have comment saying # shuffle button list). way, easy create list writing

self.buttonlist= [self.answerbtn, self.wrong1btn,                   self.wrong2btn, self.wrong3btn]  

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -