Python Code in Github Pages - Noob needs help

Hello there,

I am making a webpage for a report of a study. I would like people to be able to view plots based on inputs they give. I have that code ready in Python. How do I add it to my Github Page?

Thanks in advance.

That is not possible. GitHub Pages support only static pages, nothing that runs code on the server. For that you’ll have to find a host that lets you deploy web applications, or containers, or however else you’d like to deploy your service.

Thank you for your reply.

I went on GitHub Pages because I watched this video. This is what my output might look like. How do you think these guys did it?

thanks again.

That diagram is probably animated with CSS and Javascript, so the animation is running on the client side. If you can do it all in Javascript, a user could provide data to the script running in their browser and have it rendered, but it’d be gone as soon as they close the page (though you could include some export).

Or you could store the data to generate diagrams in your repository, and use Actions to build a static site using your Python code and commit that to the branch published by Pages. In that case users could suggest datasets to add via pull requests.


@airtower-luna Thank you so much for your help.

1 Like