Page 29 - MDP2020-1
P. 29

················································································  명장양성프로젝트  【MDP】  과제발표회  자료집  Ⅰ    |  23


                                    }
                            }
                    if(DataJson.youngjin.name  ===  user  &&  display_condition){
                                    if(DataJson.youngjin.melon  ===  "0"){

                                            menuModule(".CUSTOM1");
                                            subwayModule(".CUSTOM2");
                                    }
                                    else  if(DataJson.youngjin.menu  ===  "0"){

                                            melonModule(".CUSTOM1");
                                            subwayModule(".CUSTOM2");
                                    }
                                    else{
                                            melonModule(".CUSTOM1");
                                            menuModule(".CUSTOM2");

                                    }
                            }

                    });

            }
            function  init(){
                    setInterval(fileRead,5000);
            }
            init();



                        나)  화면  off
                            (1)  .py
            import  json
            from  flask  import  Flask
            from  collections  import  OrderedDict



            app  =  Flask(__name__)
            @app.route('/',  methods=['POST'])
            def  index():
                    file_data  =  OrderedDict()

                    file_data["shot_down"]  =  "1"
                    file_data["turn_on"]  =  "0"
                    print(json.dumps(file_data,  ensure_ascii=False,  indent="\t"))
                    with  open('words.json',  'w',encoding="utf-8")  as  make_file:
                            json.dump(file_data,  make_file,  ensure_ascii=False,  indent="\t")



            if  __name__  ==  "__main__":
   24   25   26   27   28   29   30   31   32   33   34