I have the following html code (index.html):
<!DOCTYPE html> <html> <head> <script> function addParagraphText() { var arg1=2 var arg2=34 var arg3="john" var myResult = runMe.py(arg1, arg2, arg3) document.getElementById("para").innerHTML = myResult } </script> </head> <body> <button onclick="addParagraphText();">Click me</button> <p id="para"></p> </html>
and the following python file runMe.py:
import sys myArg1 = sys.argv[1] myArg2 = sys.argv[2] myArg3 = sys.argv[3] # some long calculations using various libraries and modules myOutput = '''<table style=\"border:solid;\"><tr><td> bla </td><td> lol bla <button>myButton</button> </td></tr><tr><td> blabla </td><td> blablabla </td></tr></table>''' return myOutput
Obviously it doesn't work. What would be the easiest and quickest way to do it? I have a very long Python script that does some calculations and outputs a rather long string in html format which I would like to present after user clicks on the button. As of now, I do not need a state of the art approach, I am rather looking for a fast and easy solution.