Answer the question
In order to leave comments, you need to log in
Implement a simple web program to display a "matrix" of numbers - which way to choose?
Help me choose a way and "where to start" writing a simple "web application", the essence of which is this:
a "site" is launched on a local web server, divided logically into a "control panel" and a "matrix of numbers". The console page looks like buttons (or checkboxes) from one to six. By opening the "remote" page in the tablet browser, and the display page of the "matrix" of numbers on the TV browser, you can change the composition of the "matrix of numbers" on the TV by pressing the buttons (checkboxes). Here's a picture for clarity:
I thought I could get away with simple display:none and javascript, but it turned out that it wouldn't work :)
Answer the question
In order to leave comments, you need to log in
In order to send some kind of signal from the server side to the page already open in the browser, there is one technology - WebSocket (not counting Push , which they tried to solve this problem in the days before the advent of WebSocket).
On the server side, there are different solutions in Pyhon: (1) under Flask + Gevent (2) under Flask + uWSGI (3) ws4py and others.
There is a convenient Socket.IO library , it is a javascript client and server, it has its own high-level protocol over WebSocket (+ support for older browsers without WebSocket). The server, respectively, under node.js (does not quite fit your requirements). But there are third-party server implementations in Pythonunder Flask and without Flask . PHP for WebSocket is not the best solution and this is the
reason .
If I understand the task, I will say that client-side Javascript is difficult to manage here. But I propose a rather perverted lamer method. There is a PHP file, the frontend of which is checkboxes for the tablet. This file will generate an HTML document on the server with the desired numbers, which will be displayed on TV. And in this document, you can add a small script to auto-update the page.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question