p5 icon indicating copy to clipboard operation
p5 copied to clipboard

Output to HTML

Open ny2cali opened this issue 3 years ago • 2 comments

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()

ny2cali avatar Mar 23 '21 12:03 ny2cali

Thank you for submitting your first issue to p5py

github-actions[bot] avatar Mar 23 '21 12:03 github-actions[bot]

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

ReneTC avatar Apr 06 '21 07:04 ReneTC