コード例 #1
0
ファイル: GUI.py プロジェクト: Allenliu0703/Capdrone-Python
 def bindingConnect(self,event):
     self.portname = self.box.get()
     try:
         self.error = False
         self.message =  Serialport.serial_Setup(self.portname)
     except (OSError, serial.SerialException):
         tkinter.messagebox.showinfo("OSError", "The connection is failed!Please double check the connection :(")
         self.connectionstatus = "Serial Port is Not Connected :("
         self.label_4.config(text = self.connectionstatus, font = ("Helvetica", 12, "italic"))
         self.error = True
         self.connection = False
     if self.error:
         pass
     else:
         self.connectionstatus = "Serial Port is Connected :)"
         self.label_4.config(text = self.connectionstatus, font = ("Helvetica", 12, "italic"))
         self.connection = True
         global listener
         listener = self.message