Hi all,

Just started using Python a week or so ago, really enjoying it so far, but stuck with a project I'm working on. I'm trying to create a in-dash display system which uses Python to communicate with a piece of hardware and uses an HTML page to display the data Python receives. The frontend GUI needs to be pretty spiffy hence why I thought to use HTML (can then add Javascript, flash, etc). The HTML page will be accessible only via localhost and not on the internet.

For example, say the hardware generates the number '10493', Python then reads this, then somehow the result is displayed on the HTML page. The data generated by the hardware will be continuous at timed intervals, so the webpage needs to refresh whenever new data is received (or on a set time).

So here's where I'm stuck. I've looked into CGI but I'm not sure how to implement an automatic fetch or refresh. I would also like to have only parts of the web page refresh if possible, instead of the entire page. Any ideas how I would go about implementing this? Maybe there's a better suggestion to HTML, like Flash? Any other ideas?

Thanks in advance

Well the problem is that Python and all other CGI scripting languages are server-side scripting languages, which means they are only called when the page is requested for the first time.

From what you say, you will need some sort of client-side scripting language for the web interface. You mentioned Javascript in your post, and that would be a great place to start. You could also use Flash or Java.

I wrote a program a little while ago while was meant to be a desktop application, but I created a web interface to it using some smart CSS/Javascript. The Python does all the processing and the Javascript allows for interaction with the information presented.

Those are my ideas, and if you have any questions feel free to post back.

Edited 6 Years Ago by SoulMazer: n/a

This article has been dead for over six months. Start a new discussion instead.