是否有服务器 Python 3 websocket 模块?

编程入门 行业动态 更新时间:2024-10-23 18:22:55
本文介绍了是否有服务器 Python 3 websocket 模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我花了几天时间试图实现一个简单的服务器来与浏览器交换消息,但它不起作用(浏览器应该是我的 Python 程序的 GUI).

I spend a few days trying to implement a simple server to exchange messages with a browser but it doesn't work(the browser is supposed to be the GUI for my python program).

我环顾四周,找不到任何可以使用的已构建模块.要么是 Python 2 的模块,要么它们太复杂了.我想要一个 .py 文件,我可以用它来读取 websocket 消息并将其发送到浏览器.

I looked around and couldn't find any already built module I can use. Either are the modules for Python 2 or else they are too complex. I want a single .py file which I can use to read and send websocket messages with/to the browser.

这样的东西存在吗?

推荐答案

它可能不符合您的简单性措施,但是 websockify 中的 websocket.py" rel="nofollow">websocket.py 文件 支持 python 2.x 和 3.x 在同一个代码库中.

It might not meet your simplicity measure, but the websocket.py file inside websockify supports python 2.x and 3.x in the same code-base.

使用它的 echo 示例 非常简单.

The echo example that uses it is pretty simple.

这篇关于是否有服务器 Python 3 websocket 模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-26 05:30:54,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1130519.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模块   服务器   Python   websocket

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!