随笔分类 - python网络相关
摘要:serial和deque模块 import sys import time import re from collections import deque try: import serial.tools.list_ports PYSERIAL_INSTALLED = True except Imp
阅读全文
摘要:import serial import sys from time import sleep import time TELNET_RETURN = "\n" try: ser = serial.Serial("COM11", 115200,timeout=0, parity=serial.PAR
阅读全文
摘要:def open_telnet_connection(ip_address, port=3000): socket.setdefaulttimeout(3) try: session = telnetlib.Telnet(ip_address, int(port)) except (Connecti
阅读全文
摘要:解决黏包的问题 struct 模块 https://blog.csdn.net/weixin_33812391/article/details/111905211 # server import json import struct import socket sk = socket.socket(
阅读全文
摘要:思路1,master等待远端返回结果 from multiprocessing import Pool import os, time, random # 在远端执行的任务进程,,hang住等待返回 def long_time_task(ip,url): print('Run task %s-%s
阅读全文
摘要:基础知识 # 1. response的属性 import requests response=requests.get("http://www.baidu.com/") print(response) # <Response [200]> print(type(response)) # <class
阅读全文
摘要:# pip3 install ping3 from ping3 import ping ping_ok = lambda ip: False if ping(dest_addr=ip) is None else True print(ping_ok('192.168.11.1'))
阅读全文
浙公网安备 33010602011771号