def launch(image): """ Launches the gui application with the given image and output (if specified) Parameter image: The image file to use immediately after launch Precondition: image is a filename string or None Parameter output: The output file for saving any changes Precondition: output is a filename string or None """ from interface import launch launch(image)
def execute(): """ Executes the application, according to the command line arguments specified. """ args = parse() image = args.image # Switch on the options if args.test: unittest() elif args.grade: grade(image) else: launch(image)
import setup import interface import engine import user ############################################################### interface.launch()
if os.path.exists('saved_rules.pkl'): self.rules = pickle.load(file('saved_rules.pkl', 'r')) else: self.rules = {} if os.path.exists('saved_responses.pkl'): self.responses = pickle.load(file('saved_responses.pkl', 'r')) else: self.responses = {} ##### #main interation ##### def main(self): while True: command = raw_input('What would you like to do? ') split_command=command.split(' ') if split_command[0] == 'exit': break if self.commands.has_key(split_command[0]): self.commands[split_command[0]](split_command[1:]) else: print 'Sorry, that\'s not a recognized command. ' if __name__ == '__main__': ot = OrtoTweet() interface.launch(ot) otApi = twitter.Api('BGCXJGj3E24xIPXC3Vq1dA', 'wdn5ozSjfLRXmCWN0ObOqB0Hnb2K5rHSitYu6EpoBA', '19688598-0ArsW160fmWQ3GBiutXaDVK7R6O2MRLQPS8erLmV4', '6VtJKcxi1PXA3yUH0Dl2WuOk4Sdeo668QW4sLvclGII')