I wrote a python script to make an api call. The script returns a integer(number). I want to compare this output with a parameter that is going to pass to the script.
for example if x is the number returned by the script, I would to like to execute script as follows python test.py 20 and compare x with 20.
Please help.
Below is the script:
import json
import os, sys
import urllib2
def main():
data = json.load(urllib2.urlopen('some url'))
val = data.keys()[0]
print(val)
if __name__ == "__main__":
try:
main()
except Exception as e:
print ('!!FAIL {0}!!!'.format(e))