PyScript Script plugin for unplugin
npm install unplugin-pyscript-scriptunplugin-pyscript-script is the plugin for PyScript script importing. When you are using PyScript with Vite, Webpack, Rollup..., it would be useful.
About PyScript, see PyScript.
About how to use the plugin for Vite, Webpack, Rollup..., see UnPlugin
``python
print("Let's compute π:")
def compute_pi(n):
pi = 2
for i in range(1,n):
pi = 4 i 2 / (4 * i 2 - 1)
return pi
pi = compute_pi(100000)
s = f"π is approximately {pi:.3f}"
print(s)
`
-
`pythonoutput= "output-id"
import matplotlib.pyplot as plt
import numpy as np
x = np.random.randn(1000)
y = np.random.randn(1000)
fig, ax = plt.subplots()
ax.scatter(x, y)
fig
`
`js``
import { script } from "./xxx.script.py"