py-script で Pythonを HTML表示
# ライブラリのインポート宣言 --- (*3)
from pyscript import display #グラフのレンダリング---- #div HTML表示。
import matplotlib.pyplot as plt
X = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
H = [10.3,11.6,15.4,19.0,25.3,25.8,27.5,32.8,29.4,23.3,17.7,12.6]
L = [1.4,3.3,6.2,9.2,15.3,18.5,21.6,25.2,21.7,16.4,9.3,5.2]
#fig = plt.figure()
#plt.plot(X,H,L)
#plt.grid()
#plt.legend()
fig, ax = plt.subplots()
ax.plot(X, H)
ax.plot(X, L)
#plt.show() # displayでなくとも、HTMMLの後ろに表示
display(plt, target="mlp") #div HTML表示。
# sin波 ------------------------
import numpy as np
x = np.linspace(0,10,100)
y = np.sin(x)
fig = plt.figure()
plt.plot(x,y,c="r",label=r"sine")
plt.grid()
plt.legend()
display(plt, target="mlp") #div HTML表示。
HTML PyScript (by py04.html)
Python を、HTMLで実行表示(プラットフォーム)する py-script です。更新が激しいです。
最新版doc ... https://pyscript.net/releases/2025.3.1/core.js (このHTML)
latest/pyscript.jsから最新版へ
HTML PyScript の 詳解 古い
--------------------------------- Python -----------------------------
---my Google Colab---......Google Colabの使い方 Google Colab とは
yahoo検索 ... web python
web python ---shell---.....Shellのみ, input no ,graph
web python....下表示画面あり、input no
PyWeb..... 右表示画面あり、input ok ,graph no ; pc_example有り
---web python---.....右表示画面あり、input no ,graph ok
---JupyterLite notebooks---...表示画面あり、input ok ,graph ok