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.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

run_server.py 888B

  1. from listeningthread 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 project_reader import ProjectReader
  15. reader = ProjectReader()
  16. projects = {sc.get_project_label(): sc for sc in reader.get_project_classes()}
  17. print('Available projects: %s' % list(projects.keys()))
  18. print('')
  19. # Execute
  20. print("Executing...")
  21. do_main_program(projects)
  22. print("Done ! And now, listening...")
  23. import signal
  24. signal.signal(signal.SIGINT, program_cleanup)
  25. signal.signal(signal.SIGTERM, program_cleanup)
  26. # Wait
  27. import time
  28. while not stop:
  29. time.sleep(1)