Last active
May 4, 2022 00:33
-
-
Save KenoLeon/24027e9bd398b19a5760984fa723e2a9 to your computer and use it in GitHub Desktop.
PyScript to DOM writing example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" | |
| crossorigin="anonymous"> | |
| <script defer src="https://pyscript.net/alpha/pyscript.js"></script> | |
| <title>PyScript to DOM</title> | |
| </head> | |
| <body> | |
| <py-script> | |
| import random as rd | |
| pyscript.write('randomGoesHere', rd.random()) | |
| </py-script> | |
| <br> | |
| <div class="alert alert-info mx-auto" id="randomGoesHere" role="alert" style="width: 400px;"> | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment