时间:2021-07-01 10:21:17 帮助过:11人阅读
import socket sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sk.settimeout(1) try: sk.connect(('www.sharejs.com',80)) print 'Server port 80 OK!' except Exception: print 'Server port 80 not connect!' sk.close()
希望本文所述对大家的Python程序设计有所帮助。