0

I've got a python script that I want to build a locally-hosted web gui app for, so I can use the modern styling and tools available to web apps.

The scripts I'm running take a while to process, and I want to update the web app with visual updates, or at least something akin to what the console sees when using print() in python.

My initial hosting efforts have been based on this tutorial, and I tried out the methods in this answer to try and get data to update in a streamed fashion, but the pages only showed once the entire script was finished.

I'm wondering whether web.py could help me?

Any guidance, or even the right terms to google would be appreciated. Thanks.

--

Update: I've been reading up on node.js (something I've failed to do for years..) and, please correct me if I'm wrong, but it seems like it could be the answer. I'm even considering re-writing my original functions into node.js given the existence of this serial comms library

Community
  • 1
  • 1
Ian
  • 1,427
  • 1
  • 15
  • 27
  • https://github.com/kilianc/rtail is a Node.js library that can display your console output to the web. – Rahat Mahbub Jul 20 '15 at 03:11
  • 1
    I would suggest to use a .js function that does a callback to a python class which knows the state of your process. i.e. via a db lookup or so – PlagTag Jul 28 '15 at 11:28
  • Thanks but I've actually made some progress on this now. I setup a cgi-hosted polymer site that speaks to a WSGI hosted python script that's hosted in an iframe. Because they had to be hosted on different ports, communication of messages and JSON happens through an eventlistener on the main page, waiting for "message" events. I get the benefits of Polymer making it look good and function well, as well as good python functionality – Ian Jul 28 '15 at 15:23

0 Answers0