please solve this error
def TakeImages():
Id=(text.get())
name=(text2.get())
if(is_number(Id) and name.isalpha()):
cam=cv2.VideoCapture(0)
harcascadePath = "haarcascade_frontalface_default.xml"
sampleNum=0
while(True):
ret,img= cam.read()
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
faces= detector.detecMultiScale(gray,1.3,5)
for (x,y,w,h) in faces:
cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0,2)
sampleNum = sampleNum+1
cv2.imwrite("TrainingImages\ "+name +" "." + Id + '.' +str(sampleNum) + ".jgp", gray[y:y+h,x:x+h])
cv2.imshow('Frame',img)
if cv2.waitKey(100) & OxFF "" ord('q'):
break
elif sample>60:
break
cam.release()
cv2.destroyAllWindows()
res = "Images Saved or ID: " Id + "Name : "+ name
row = [Id,name]
with open('StudentDetails\studentDetails.csv', 'a+') as csvFile:
writer = csv.writer (csvFile)
writer.writerow(row)
csvFile.close()
message.configure(text=res)
else:
if(is_number(Id)):
res ="Enter Alphabetical Name"
message.configure(text=res)
if (name.isalpha()):
res="Enter numeric Id"
message.configure(text=res)
cv2.destroyAllWindows()
File "<ipython-input-90-4efc38272594>", line 14 sampleNum = sampleNum+1 ^
SyntaxError: invalid syntax