Guest User

Untitled

a guest
Dec 10th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. from requests import post as u
  2. from _thread import*
  3. import os
  4. os.system("start cmd /C python s")
  5. def l():
  6. def p(q):
  7. while 1:print(u(*q).text,end="r")
  8. q=['http://localhost:8080/']
  9. q+=[u(q[0],'*').text]
  10. start_new_thread(p,(q,))
  11. input()
  12. u(q[0],'-'+q[1])
  13. while 1:
  14. try:l();break
  15. except:0
  16.  
  17. from bottle import*
  18. from requests import post as q
  19. try:
  20. q("http://localhost:8080/")
  21. except:
  22. ids=["0"]
  23. @post('/')
  24. def _():
  25. content = request.body.read().decode('utf-8')
  26. if len(content)==0:return""
  27. if content[0]=="*":ids.append(str(int(ids[-1])+1));return str(ids[-1])
  28. elif content[0]=="-":del ids[ids.index(content[1:])]
  29. else:return str(ids.index(content)) + "/" + str(len(ids)-1)
  30. run()
Add Comment
Please, Sign In to add comment