python通过socket实现网络广播代码,pythonsocket,import socke
python通过socket实现网络广播代码,pythonsocket,import socke
import socket, sysdest = ('<broadcast>', 51423)s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)s.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)s.sendto("Hi", dest)print "Looking for replies; press Ctrl-C to stop."while 1: (buf, address) = s.recvfrom(2048) if not len(buf): break print "Received from %s: %s" % (address, buf)
相关内容
- python使用 htmllib 分析网页内容,pythonhtmllib,import htmll
- python中localtime和gtime的区别及时区计算,localtimegtime,l
- python自动修改本机网关的代码,python网关,#!/usr/bin/p
- Python判断给定的数是否是回文数,,def isPalind
- python检测远程udp端口是否打开,python检测udp端口,impor
- Powell’s method of minimizing user-supplied function in Python,,'
- Python多线程应用详解,python多线程详解,一、Python中的线
- 一个简单的python定时器实现,python定时器,下面介绍以
- Gauss-Legendre integration in Python,,''' I = gaus
- python获取从命令行输入的数字代码演示,python命令行
评论关闭