Page 686 - 3-3
P. 686

su_ser.send(str(day.tm_wday).encode())
                    # 현재 요일을 보냄


                    su_ser.send(current_class.encode())
                    # 현재 몇 교시인지를 보냄


                    print (num,num,status,reason,day.tm_wday,current_class)
                    # 보낸 정보들을 재확인 용으로 출력시킴


            def pick_data():
            # 데이터를 얻어오는 메쏘드


                    indoor_t = open("indoor.txt",'r')
                    # 실내에서 받아온 정보인지 확인하는 텍스트파일 염


                    indoor = indoor_t.read()
                    #indoor 변수를 통해 값을 받아 옴


                    print(indoor)
                    # 확인용으로 출력시킴


                    current_class_t=open("current_class.txt",'r')
                    # 현재 몇 교시인지 확인하는 텍스트 파일 염


                    current_class=current_class_t.read()
                    #current_class  변수를 통해 현재 교시를 받아 옴


                    if indoor != 'out':
                    # 만약 실내에서 찍힌 상황일 경우


                            with open("indoor.txt",'w') as i :
                            # 실내에서 받아온 정보인지 확인하는 텍스트 파일 염


                                    i.write('out')
                                    # 실외로 바꿔 둠


                            return indoor,"6","6",current_class
                            # 실내에서 정상 출석으로 찍었음을 의미하는 66                  과 함께 데이터를 넘김


                    else:
                    # 실외에서 찍혔을 경우


                            num_t=open("num.txt",'r')
                            # 학번을 저장하는 텍스트 파일을 염




                                                        - 686 -
   681   682   683   684   685   686   687   688   689   690   691