def main2(): http_server.main() time.sleep( 1 ) print "..." _BRAIN=BRAIN() t2 = threading.Thread( target=_BRAIN.run ) t2.start()
def main(): http_server.main(port=80)
from importlib import reload from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler import http_server http_temp = http_server class MyHandler(FileSystemEventHandler): def on_modified(self, event): if event.src_path.split('\\')[1] == 'http_server.py': print('Reloaded ' + event.src_path.split('\\')[1]) try: reload(http_server) except SyntaxError: print('Syntax error in ' + event.src_path.split('\\')[1]) except: raise if __name__ == "__main__": event_handler = MyHandler() observer = Observer() observer.schedule(event_handler, path=r'HTTP & CGI Servers', recursive=False) observer.start() http_server.main()
def emulation(): flashlights = {} main(flashlights) server = FlashLightServ(flashlights=flashlights) server.listen(9999)
#GLOBAL.NETWORK_TABLE={} NETWORK=True #NETWORK=False TRAINING = True #TRAINING = False def init(): pass import http_server http_server.main() time.sleep( 1 ) #pyaudio def ProcessSound( Prog , Prog_id=None ): global GA_NN_obj #global ENERGY_init if Prog_id != None: #crash() Prog=GA_NN_obj.Progs[ Prog_id ] Prog.init3() Prog.Prog_ORDERS=[] Prog.i=1