timmy / 使用 Streamlit 建立 WebSocket 伺服器與客戶端
0 вподобань
0 форк(-ів)
1 файл(-ів)
Остання активність 10 months ago
| 1 | import asyncio |
| 2 | import websockets |
| 3 | import streamlit as st |
| 4 | import threading |
| 5 | import socket |
| 6 | |
| 7 | # Function to check if a port is free |
| 8 | def is_port_free(port): |
| 9 | with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: |
| 10 | return s.connect_ex(('localhost', port)) != 0 |
Новіше
Пізніше