Forums

Continuous Display of Data on Website from External Python Code

Hi,

Apologies if this has been posted elsewhere but I'm pretty fresh to pythonanywhere (and python in general) and couldn't see (or understand) anything that would help in what I'm trying to do.

What I'm ideally looking to do is to have a webpage which displays the results of a machine learning python code which I have running elsewhere, allowing the results to be viewable anywhere. As such, I need to send a package with the results and print this/graph it for viewing using the web app.

I've managed to create a web app in flask using pythonanywhere which allows me to query it with a payload and receive a response back from a tutorial, but I am struggling to see how I can send a package of data and have this displayed on a webpage, staying the same until a fresh set of data is sent/a user refreshes the page.

Any help or link to appropriate guidance is very much appreciated and again apologies if this is a simple or already documented request.

Thanks.

Looks like you need some frontend code in the browser polling some backed api for the data. Something similar to https://blog.pythonanywhere.com/198/ but different to meet your needs.

Thank you - I'll check it out.