mercredi 8 mars 2017

How can I run python script on a wordpress web page?

import requests
requests.packages.urllib3.disable_warnings()
from requests.auth import HTTPBasicAuth
import json
import time
import threading

def main():
    threading.Timer(10.0, main).start()
    print(" ")
    print "En este momento tenemos: "
    username = 'learning'
    password = 'learning'
    restURL = 'http://ift.tt/2m3SdAV'
    request = requests.get(
    url = restURL,
    auth = HTTPBasicAuth(username,password),
    verify=False)
    parsed = json.loads(request.content)
    #print (json.dumps(parsed, indent=2))
    cuenta = parsed["total"]
    print (str(cuenta["total"]) + " Clientes")


if __name__ == "__main__":
    main()

I'm using this code to connect the Cisco Sandbox and retrieve a number. I want a web page showing the retrieved number and update automatically




Aucun commentaire:

Enregistrer un commentaire