I have created a python script that turns my house lights on and a similar one that turns them off. I am trying to figure out how I can create a web page on localhost:8000 that has 2 buttons, one saying on and one saying off. For example, if the scripts were called lightsOn.py and lightsOff.py and saved in D:/Users/Name/Documents/ I would want the on button to somehow run 'python lghtsOn.py' It does not have to search for the python file on my PC but instead, it may be easier to just embed the python code in the web server.
Thanks in advance!
Please let me know if this question is acceptably formatted as I do not post here a lot.
Aucun commentaire:
Enregistrer un commentaire