I have a number of python scripts that I have saved on my computer, out of curiosity I have created a html file that just has one button. Instead on going into the terminal and running python <path to script>
, I would like to make it so when that button is clicked, is kicks off one of my python scripts. Is this possible/how can it be done?
for example purposes we'll call the script to be run MYSCRIPT.py
. I've done a little research but have come up with nothing promising. I'm aware the following code is incorrect but just for a starting point here is my html file.
<!DOCTYPE html>
<html>
<body>
<head>
<input type="button" id='script' name="scriptbutton" value=" Run Script " onclick="exec('python MYSCRIPT.py');">
</head>
</body>
</html>