demo:
1. index.html
PyScript Hello World
print('Hello world!')
print('This is the current date and time, as computed by Python:')
from datetime import datetime
now = datetime.now()
datetime = now.strftime("%m/%d/%Y, %H:%M:%S")
pyscript.write('myDate',datetime)
- matplotlib
2. main.py
import numpy as np
import matplotlib.pyplot as plt
x= np.array([1,3,5])
y=[2,4,6]
z=np.exp(x)
w=np.exp(y)
plt.plot(x,z,color="blue",marker='*')
plt.plot(y,w,color="red",marker='o')
plt.xlabel("X Axis--------->")
plt.ylabel("Y Axis--------->")
plt
3. 运行结果
资源列表:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)