Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from google.appengine.api import urlfetch
- import urllib
- HACKEREARTH_CLIENT_SECRET = 'd07bff3fc29148e7243bf894e584904afafedcdd'
- HACKEREARTH_RUN_URL = 'http://api.hackerearth.com/code/run/'
- data = {
- 'source': """
- def cong(a,b):
- return a+b
- print "Hello World"
- print "123"
- print cong(3,4)
- """,
- 'lang': "PYTHON",
- 'time_limit': 5,
- 'memory_limit': 262144,}
- data.update({'client_secret': HACKEREARTH_CLIENT_SECRET})
- data.update({'async': 0})
- form_data = urllib.urlencode(data)
- result = urlfetch.fetch(url=HACKEREARTH_RUN_URL,
- payload=form_data,
- method=urlfetch.POST)
- print result.content
Add Comment
Please, Sign In to add comment