p5
p5 copied to clipboard
Output to HTML
First time opening an issue. I got the following working as a trial to use python function such as pandas and p5 functionality together. The output comes in a new window. How would I get this output to either an existing HTML site or a new site?
Also, wanted to acknowledge the great efforts put into this to couple two great ideas such as python and p5. Now, I just need a third element added which is the web :-)
from p5 import * import pandas as pd
data = {'A':[1],'B':[2],'C':[300],'D':[200]} df = pd.DataFrame(data)
def setup():
size(640, 360)
stroke('black')
no_stroke()
background(204)
def draw(): global df ellipse(df['C'],df['D'],50,50)
if name == 'main': run()
Thank you for submitting your first issue to p5py
You can save the output by using save_frame("path/file_name.png") in the draw loop as an image and display that? I don't think this package can run on a website.. At least not very effectively, I would rather use normal JavaScript p5 for implementing some interactive p5 on a website