Simulate graph states in the browser
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

25 строки
484B

  1. """
  2. Makes a dummy post to the test server
  3. """
  4. import requests
  5. import json
  6. import abp
  7. #URL = "http://localhost:5000"
  8. URL = "https://abv.peteshadbolt.co.uk/"
  9. def test_graph():
  10. N = 100
  11. g = abp.NXGraphState(range(N))
  12. for i in range(N-1):
  13. g.act_cz(i, i+1)
  14. g.layout()
  15. return g
  16. if __name__ == '__main__':
  17. data = json.dumps(test_graph().to_json(stringify=False))
  18. r = requests.post("{}/graph".format(URL), data=data)
  19. print r.status_code, r.content