From: Satya G. <sg...@be...> - 2003-08-06 22:17:56
|
Hello there, In the interactive shell, I would like to interact with the user in such a way that depending on the input, I would like to perform different actions. For example, I would like to write a module, 'stopServer()', if invoked should ask the user if he really wants to stop the server and depending on 'y/n', the function executes the appropriate function. For example: def stopServer(): print 'Are you sure you want to exit? (y/n)' # some prompt that reads the input from the user and stores in a variable say, 'input' if input == "y": exitServer() else: # dont do any thing Any pointers are greatly appreciated! -satya |