Last active
May 3, 2022 20:12
-
-
Save KenoLeon/a1afffa7b337f9bf5a3c171e3e5b8a45 to your computer and use it in GitHub Desktop.
Imports in PyScript
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 rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /> | |
| <script defer src="https://pyscript.net/alpha/pyscript.js"></script> | |
| <title>Imports in Pyscript, Numpy,Random in the Browser !</title> | |
| <py-env> | |
| - numpy | |
| </py-env> | |
| </head> | |
| <body> | |
| <py-script> | |
| <!-- from pyodide packages : --> | |
| import numpy as np | |
| <!-- from standard lirary :--> | |
| import random as rd | |
| <!-- make linspace numpy --> | |
| x = np.linspace(0, 10, 20) | |
| print('linspace: ', x) | |
| print('random: ', rd.random()) | |
| </py-script> | |
| </body> | |
| </html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment