如何将 Python Tkinter Applet 获取到网页 [英] How to get a Python Tkinter Applet to Web Page
问题描述
我使用 Tkinter 库用 Python 编写了一个小程序.我完成了小程序的编写,但现在我想在我的网站上公开它.有谁知道让python脚本在我的网站上工作的方法?我不希望它必须是需要下载的东西,但如果可能的话可以在浏览器中运行.谢谢!
I wrote an applet in Python using the Tkinter library. I finished writing the applet but now I want to make it public on my website. Does anyone know a way to get the python script to work on my website? I don't want it to have to be something that needs to be downloaded, but can just run in the browser if possible. Thanks!
推荐答案
你问的是不可能的.几年前有一个 Tcl/Tk 浏览器插件,但上一次有人接触这个 sourceforge 项目是在 2006 年. 我严重怀疑它是否可以与 tkinter 一起使用.就此而言,我怀疑它也适用于 tcl/tk.从那时起,浏览器有了很大的进步.
What you ask is not possible. Several years ago there was a Tcl/Tk browser plugin, but the last time anyone touched that sourceforge project was back in 2006. I seriously doubt it could be made to work with tkinter. For that matter, I doubt it works for tcl/tk either. Browsers have advanced quite a bit since then.
不,让它在 jython 中工作以便您可以通过 java 插件运行它无济于事.Tkinter 通过直接使用 tcl/tk 解释器来工作.tcl/tk 解释器不会在 JVM 中运行.
And no, getting it to work in jython so you can run it via a java plugin won't help. Tkinter works by working directly with a tcl/tk interpreter. The tcl/tk interpreter won't run in the JVM.
这篇关于如何将 Python Tkinter Applet 获取到网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!