Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from requests import post as u
- from _thread import*
- import os
- os.system("start cmd /C python s")
- def l():
- def p(q):
- while 1:print(u(*q).text,end="r")
- q=['http://localhost:8080/']
- q+=[u(q[0],'*').text]
- start_new_thread(p,(q,))
- input()
- u(q[0],'-'+q[1])
- while 1:
- try:l();break
- except:0
- from bottle import*
- from requests import post as q
- try:
- q("http://localhost:8080/")
- except:
- ids=["0"]
- @post('/')
- def _():
- content = request.body.read().decode('utf-8')
- if len(content)==0:return""
- if content[0]=="*":ids.append(str(int(ids[-1])+1));return str(ids[-1])
- elif content[0]=="-":del ids[ids.index(content[1:])]
- else:return str(ids.index(content)) + "/" + str(len(ids)-1)
- run()
Add Comment
Please, Sign In to add comment