-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
30 lines (20 loc) · 674 Bytes
/
test.py
File metadata and controls
30 lines (20 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import tornado.ioloop
import tornado.web
import tornado.httpclient
import random
import sys
import time
import urllib
import httplib2
httplib2.debuglevel=1
http = httplib2.Http()
from subprocess import Popen
p = Popen("server1.bat", cwd=r"C:\Users\Kempo\Desktop\lecture notes\Distributed systems\Course work\Work")
stdout, stderr = p.communicate()
"""
post_data = { 'user': 'Keijo',
'guess': 'Tails'} #A dictionary of your post data
body = urllib.urlencode(post_data) #Make it into a post request
response,content= http.request("http://localhost:8889/coordinator/", method='GET', headers=None, body=body) #Send it off!
print "Response "+ content
"""