Any way to run python TK scripts on web page?

泄露秘密 提交于 2021-02-05 10:47:26

问题


Is there any way to run a python script that utilizes TKinter on a web page such that a user could run the script and interact with the TK windows without having to download the script or have the appropriate python interpreter?


回答1:


No. There is no way to do this.




回答2:


The only approach I can think of, is to use some virtual screen protocol such as VNC, run your Tkinter script on a server for that protocol (e.g., a VNC server), and use a viewer browser plug-in for that protocol in the user's browser (e.g., maybe this one -- haven't tried it myself, though). A similar approach could use the NX protocol (e.g., cfr here).

Note that such solutions will most likely not scale well: they're mostly meant to let one user connect to "their desktop" from a browser. Performance, robustness and scalability of web-native approaches will all run rapid circles around any such "compatibility hack"!



来源:https://stackoverflow.com/questions/3284779/any-way-to-run-python-tk-scripts-on-web-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!