def save_camera_options(self): try: config.camera_port = int(self.camera_port_entry.get()) config.camera = self.variable1.get() config.file_type = self.variable2.get() except ValueError: top = Toplevel() top.iconbitmap('plantIcon.ico') top.title("Error...") msg = Message(master=top, text="Error! Please enter only numbers!") msg.pack() finally: if self.control.debug: config.printConfig() config.writeConfig()
def savesettings(self): try: #set the config vars config.length = float(self.length_entry.get()) config.speed = float(self.velocity_input.get()) #connect with robot self.control.setPort(int(self.port_entry.get())) self.control.setBaud(int(self.baud_entry.get())) self.control.openConnection() except ValueError: top = Toplevel() top.iconbitmap('plantIcon.ico') top.title("Error...") msg = Message(master=top, text="Error! Please enter only numbers!") msg.pack() finally: if debug.debug: config.printConfig() config.writeConfig() self.toplevel.destroy()
import config config.printConfig() config.readConfig() print "\n" config.printConfig() config.speed = 0 config.camera = "Cannon EOS5" config.writeConfig() print "\n" config.printConfig()