python - 为 python 应用程序创建 Web 界面的最佳策略是什么?

标签 python user-interface

我创建了一个简单的基于 gstreamer 的 python 音频应用程序,它带有一个 GTK+ GUI,用于从 XML 列表中挑选和播放网络流。然后我将我的 PC 扬声器输出连接到带有大扬声器和 presto 的旧立体声接收器的输入,我有一个非常好的音响系统,在我家里的大部分地方都能听到。

现在我想添加一个 Web 用户界面,以便从有计算机的房间以外的房间远程控制应用程序,但到目前为止,我所有的尝试都没有结果。

特别是我想知道是否有可能创建一种带有信号的套接字,例如 GTK GUI 的信号,以运行更改 gstreamer 参数的方法。

或者是否有更现实/可行的策略?

在此先感谢您的帮助!

最佳答案

你可以使用 Bottle ,一个非常简单的微型网络框架。

Bottle is a fast, simple and lightweight WSGI micro web-framework for Python. It is distributed as a single file module and has no dependencies other than the Python Standard Library.

Hello World :

from bottle import route, run

@route('/hello/:name')
def index(name='World'):
    return '<b>Hello %s!</b>' % name

run(host='localhost', port=8080)

关于python - 为 python 应用程序创建 Web 界面的最佳策略是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8747865/

相关文章:

python - 如何在 Python 中将定义的字典传递给 **kwargs?

user-interface - databricks 初始化脚本 UI 为空

java - 将多个 Jtextarea 添加到同一个 JScrollPane 中

java - SwingWorker、Thread.sleep() 还是 javax.swing.timer?我需要 "insert a pause"

html - 在 JSP 页面中获取当前语言环境日期格式

python - Abaqus python 脚本 - 在 .mdb 中创建的元素集无法在 .odb 中访问

python ,NLTK : NameError: name 'load_parser' is not defined

python - 使用 Pandas 获取所有具有日期时间类型的列?

c++ - Qt 工具窗口可在 Mac 上调整大小

python - 为什么我的 ttk.Treeview 单击处理程序在 tree.focus() 上返回错误的项目?