iT邦幫忙

0

python成功執行,但是其語法畫面一直不斷顯示__del__

  • 分享至 

  • xImage

我擷取程式內部分語法
把格子內數字變成變數
有格子的變浮點數
程式可以成功在背景執行
也就是使用pyqt製造出的介面後
可以成功執行任務
但是程式開啟的提示字元卻一直出現__del__
"我不知道會出現多久 沒試過七個目標點都結束他還會不會出現 所以我先來問問大大 是不是我語法宣告變數之類的沒有關閉"(因為我查的結果好像是這樣)

    

        x1=self.ui.lineEdit_2.text()  #將格子的數字換成變數
        y1=self.ui.lineEdit_3.text()
        
        x2=self.ui.lineEdit_4.text()
        y2=self.ui.lineEdit_5.text()
        
        x3=self.ui.lineEdit_6.text()
        y3=self.ui.lineEdit_7.text()

        x4=self.ui.lineEdit_8.text()
        y4=self.ui.lineEdit_9.text()
 
        x5=self.ui.lineEdit_10.text()
        y5=self.ui.lineEdit_11.text()
       
        x6=self.ui.lineEdit_12.text()
        y6=self.ui.lineEdit_13.text()
      
        x7=self.ui.lineEdit_14.text()
        y7=self.ui.lineEdit_15.text()
     
        
        if (x1=="") or (y1 ==""):     #有變數的轉成浮點數 沒有的就不用轉了
            print("First No Target")
      
        else:
            x1=float(x1)       
            y1=float(y1)
            
            
        if (x2=="") or (y2 ==""):
            print("Second No Target")
      
            
        else:
            x2=float(x2)        
            y2=float(y2)

        if (x3=="") or (y3 ==""):
            print("Third No Target")
        
        else:
            x3=float(x3)        
            y3=float(y3)
        
        if (x4=="") or (y4 ==""):
            print("fourth No Target")
           
        else:
            x4=float(x4)        
            y4=float(y4)  
        
        if (x5=="") or (y5 ==""):
            print("Fivth No Target")
        
        else:
            x5=float(x5)        
            y5=float(y5)
        
        if (x6=="") or (y6 ==""):
            print("sixth No Target")
           
        else:   
            x6=float(x6)        
            y6=float(y6)
         
        if (x7=="") or (y7 ==""):
            print("Seventh No Target")
           
        else:
            x7=float(x7)        
            y7=float(y7)
            
        #=================    
        def moveto():  
         
            while True:       
                if (x1=="") or (y1 ==""):
                    print("First No Targetp")
                    time.sleep(3)
                    break         
                else:
                    print("Next Target")
                    me.move2target(x1, y1, 3.038, 10, 30, "First")
                    time.sleep(3)
                    break 
              
            while True:
                if (x2=="") or (y2 ==""):
                    print("Second No Target")
                    time.sleep(3)
                    break
                elif status == 900:
                    print("Next Target")
                    me.move2target(x2, y2, 3.038, 10, 30, "Second")  
                    time.sleep(3)
                    
                    break
                           
                   
                    
            while True:      
                if (x3=="") or (y3 ==""):
                    print("Third No Target")
                    time.sleep(3)
                    break
                elif status == 900:
                    print("Next Target")
                    me.move2target(x3, y3, 3.038, 10, 30, "Third")
                    
                    time.sleep(3)                               
                    break
              
            while True:
                if (x4=="") or (y4 ==""):
                    print("fourth No Target")
                    time.sleep(3)
                    break
                elif status == 900:
                    print("Next Target")#move2target(x,y) 指定要去的目標點
                    me.move2target(x4, y4, 3.038, 10, 30, "fourth")
                   
                    time.sleep(3)
                    break 
                
            while True:            
                if (x5=="") or (y5 ==""):
                    print("Fivth No Target")
                    time.sleep(3)
                    break
                elif status == 900:
                    print("Next Target")#move2target(x,y) 指定要去的目標點
                    me.move2target(x5, y5, 3.038, 10, 30, "Fivth")
                    
                    time.sleep(3)
                    break
               
            while True:
                if (x6=="") or (y6 ==""):
                    print("sixth No Target")
                    time.sleep(3)
                    break
                elif status == 900:   
                    print("Next Target")#move2target(x,y) 指定要去的目標點
                    me.move2target(x6, y6, 3.038, 10, 30, "sixth")
                  
                    time.sleep(3)
                    break
                
            while True:
                if (x7=="") or (y7 ==""):
                    print("Seventh No Target")
                    time.sleep(3)
                    break
                elif status == 900:
                    print("Next Target")#move2target(x,y) 指定要去的目標點
                    me.move2target(x7, y7, 3.038, 10, 30, "Seventh")
                    
                    time.sleep(2)
                    break
       
            a2=threading.Thread(target = change)
            a2.start() 

https://ithelp.ithome.com.tw/upload/images/20221024/20131917chzYtqdcjH.png

大學實習中的小小工程師!!
需要各位幫忙
或是提供意見或是可能成功的方法都可以..
因為好不容易搞出成功的程式了!!
但是一直顯示這個"del"
while迴圈內我都break了 為什麼還有就搞不懂!!!
= =!!頭好痛啊!!

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

我要發表回答

立即登入回答