Python-ELMO is a Python library which offers an encapsulation of the binary tool ELMO, in order to manipulate it easily in Python and SageMath script.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

run_server.py 878B

  1. from .servicethread import ListeningThread
  2. from .executorthread import ExecutorThread
  3. def do_main_program(projects):
  4. global thread, stop
  5. thread = ListeningThread('localhost', 5000, ExecutorThread, projects=projects)
  6. thread.start()
  7. def program_cleanup(signum, frame):
  8. global thread, stop
  9. thread.stop()
  10. stop = True
  11. thread = None
  12. stop = False
  13. # Information
  14. from .manage import search_simulations
  15. projects = {sc.get_project_label(): sc for sc in search_simulations_in_module().values()}
  16. print('Available module projects: %s' % list(projects.keys()))
  17. print('')
  18. # Execute
  19. print("Executing...")
  20. do_main_program(projects)
  21. print("Done ! And now, listening...")
  22. import signal
  23. signal.signal(signal.SIGINT, program_cleanup)
  24. signal.signal(signal.SIGTERM, program_cleanup)
  25. # Wait
  26. import time
  27. while not stop:
  28. time.sleep(1)