使用python开发桌面应用程序的HTML/Javascript/CSS GUI?

Jur*_*ocs 5 html css python user-interface

我想知道是否有像pyqt等的python GUI,纯粹使用html和javascript来布局桌面应用程序......

你知道是否有这样的项目吗?这是否有意义;-)或者它只是我发现一个很好的工具......

Ble*_*der 10

如果它是基于Python但与Python无关,你真的会关心它是不是基于Python吗?

无论如何,是的,一个项目存在.一个非常大的一个.它被称为XULRunner.该项目由Mozilla维护,用于每个Mozilla程序的GUI.

它具有基于XML的语法(XUL):

<?xml version="1.0"?>

<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

<window id="main" title="My App" width="300" height="300" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <script type="application/javascript" src="chrome://myapp/content/main.js"/>

  <caption label="Hello World"/>
  <separator/>
  <button label="More >>" oncommand="showMore();"/>
  <separator/>
  <description id="more-text" hidden="true">This is a simple XULRunner application. XUL is simple to use and quite powerful and can even be used on mobile devices.</description>

</window>
Run Code Online (Sandbox Code Playgroud)

和JavaScript:

function showMore() {
  document.getElementById("more-text").hidden = false;
}
Run Code Online (Sandbox Code Playgroud)

您甚至可以将Python脚本嵌入到您的代码中:http://pyxpcomext.mozdev.org/no_wrap/tutorials/pyxulrunner/python_xulrunner_about.html