[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Keyboard inputs & file navigator



The simplest way to do this is to use the console window.

name = raw_input("Enter your name: ")   -> name = "Jouley" (or whatever)

Store the names and questions in a list and use random.choice() to
pick one at random.

import random
questions = ["How old are you?",
                   "How many is 3 + 2?",
                   "Explain the Wurtz Reaction."]
print random.choice(questions) -> "Explain the Wurtz Reaction." (Or something).

Making the GUI in Pygame is significantly more complex.  You can
render font and get keypresses and the like.  wxPython is also an
option.

Ian