title: How to get rid of this problem in openCV tkinter code
body: <p>I am working on a facial recognition based attendance system .This is my first project so i am not well acquainted with how to deal with errors. I am stuck in the middle and don't know how to solve the error. My terminal displays the following error:</p>
  <pre><code>PS E:\Project Work&gt; &amp; &quot;C:/Users/Naik Faheem/AppData/Local/Programs/
  Python/Python39/python.exe&quot; &quot;e:/Project Work/test.py&quot;
  Exception in Tkinter callback
  Traceback (most recent call last):
          File &quot;C:\Users\Naik Faheem\AppData\Local\Programs\Python\
          Python39\lib\tkinter\__init__.py&quot;, line 1892, in __call__
  return self.func(*args)
  File &quot;e:\Project Work\test.py&quot;, line 62, in face_recog
      img=recognize(img,clf,facecascade)
  File &quot;e:\Project Work\test.py&quot;, line 52, in recognize
      coord= draw_boundary(img,facecascade,1.1,10,255,&quot;Face&quot;,clf)
  File &quot;e:\Project Work\test.py&quot;, line 39, in draw_boundary
  n=&quot;+&quot;.join(n)
  TypeError: can only join an iterable
  [ WARN:1] global C:\Users\runneradmin\AppD
  </code></pre>
  <p>I HAVE PUT MY ACTUAL CODE BELOW.This code is intended to read classifier.xml file that stores the trained dataset.</p>
  <pre><code>from tkinter import *
  from PIL import Image, ImageTk
  from tkinter import ttk
  from tkinter import messagebox
  import mysql.connector
  import cv2
  
  class Face_recognition:
      def __init__(self,root):
          self.root=root
          self.root.title('Face Detection')
          self.root.geometry('1500x800+0+0')
          self.root.config(bg='gray')
  
          title_lbl=Label(self.root,text='FACE RECOGNITION',
                     font=('times new roman',35,'bold'),bg='gray',fg='darkblue')
          title_lbl.place(x=0,y=0,width=1500,height=40)
  
          btn=Button(self.root,command=self.face_recog,text='Detect Face',
                                             font=('times new roman',12,'bold'),bg='red')
          btn.place(x=650,y=60,width=200,height=40)
  
      def face_recog(self):
          def draw_boundary(img,classifier,scaleFactor,minNeighbors,color,text,clf):
              gray_image=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
              features = classifier.detectMultiScale(gray_image,scaleFactor,minNeighbors)
  
              coord= []
  
              for (x,y,w,h) in features:
                  cv2.rectangle(img,(x,y),(x+w,y+h),255,3)
                  id,predict= clf.predict(gray_image[y:y+h,x:x+w])
                  confidence= int(100*(1-predict/300))
  
              
                  con= mysql.connector.connect( user='root', host='localhost', 
                                         password='',database='stu_details')
                  cur=con.cursor()
                  cur.execute(&quot;select name from stu_info where name= &quot;+str(id-1))
                  n=cur.fetchone()
                  n=&quot;+&quot;.join(n)
              
                  if confidence&gt;70:
                      cv2.putText(img,f&quot;Name: {n}&quot;,(x,y-60),cv2.FONT_HERSHEY_COMPLEX,1,255,2)
                  else:
                      cv2.rectangle(img,(x,y),(x+w,y+h),(255,255,255),4)
                      cv2.putText(img,&quot;Unknown face&quot;,(x,y10),
                                 cv2.FONT_HERSHEY_COMPLEX_SMALL,0.8,(255,255,255),3)
  
                      coord=[x,y,w,h]
                  return coord
              def recognize(img,clf,facecascade):
                         coord= draw_boundary(img,facecascade,1.1,10,255,&quot;Face&quot;,clf)
                         return img
  
             facecascade= cv2.CascadeClassifier(&quot;haarcascade_frontalface_default.xml&quot;)
             clf= cv2.face.LBPHFaceRecognizer_create()
             clf.read(&quot;classifier.xml&quot;)
  
            video_cap=cv2.VideoCapture(0)
            while True:
                 ret,img=video_cap.read()
                 img=recognize(img,clf,facecascade)
                 cv2.imshow(&quot;Welcome to face recognition&quot;,img)
  
  
                if cv2.waitKey(1)==13:
                    break
  
             video_cap.release()
             cv2.destroyAllWindows()
  
  
  
  if __name__ == '__main__':
      root=Tk()
      app=Face_recognition(root)
      root.mainloop()
  </code></pre>