Ben Finney <ben+pyt...@benfinney.id.au> writes: [...] > commands = { > 'q': (lambda: quit()), > 'c': (lambda: prompt_and_convert_temperature( > ["Celsius", "Fahrenheit"], celsius_to_fahrenheit)), > 'f': (lambda: prompt_and_convert_temperature( > ["Fahrenheit", "Celsius"], fahrenheit_to_celsius)),
None: print_commands, > } > > > if __name__ == '__main__': > choice = None > while choice is None: > choice = raw_input("Command: ") commands.get(choice)() -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list