Python goes HTML
PyScript lets you run Python code in web pages. If the web and Python had a baby, you'd get PyScript.
- first: You have to enable shell_exec() from your server
- second: insert <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /> <script defer src="https://pyscript.net/alpha/pyscript.js"></script> into the head of your web page
- third: Write the following Script in a .py-file within a folder named py
a=47.541379 b=175.457931 if a > b: print(round(a/b,3)) else: print(round(b/a,3))
- fourth: Write the following Script in a .php-file
<?php
echo shell_exec("python py/index.py");
?>
- Last: The Result is: 3.691
▸ Online Editor