随笔分类 -  python网络相关

摘要:serial和deque模块 import sys import time import re from collections import deque try: import serial.tools.list_ports PYSERIAL_INSTALLED = True except Imp 阅读全文
posted @ 2021-09-15 15:14 该显示昵称已被使用了 阅读(150) 评论(0) 推荐(0)
摘要:import serial import sys from time import sleep import time TELNET_RETURN = "\n" try: ser = serial.Serial("COM11", 115200,timeout=0, parity=serial.PAR 阅读全文
posted @ 2021-09-13 10:52 该显示昵称已被使用了 阅读(126) 评论(0) 推荐(0)
摘要:def open_telnet_connection(ip_address, port=3000): socket.setdefaulttimeout(3) try: session = telnetlib.Telnet(ip_address, int(port)) except (Connecti 阅读全文
posted @ 2021-09-10 13:57 该显示昵称已被使用了 阅读(110) 评论(0) 推荐(0)
摘要:解决黏包的问题 struct 模块 https://blog.csdn.net/weixin_33812391/article/details/111905211 # server import json import struct import socket sk = socket.socket( 阅读全文
posted @ 2021-08-28 10:04 该显示昵称已被使用了 阅读(23) 评论(0) 推荐(0)
摘要:思路1,master等待远端返回结果 from multiprocessing import Pool import os, time, random # 在远端执行的任务进程,,hang住等待返回 def long_time_task(ip,url): print('Run task %s-%s 阅读全文
posted @ 2021-08-17 15:25 该显示昵称已被使用了 阅读(41) 评论(0) 推荐(0)
摘要:基础知识 # 1. response的属性 import requests response=requests.get("http://www.baidu.com/") print(response) # <Response [200]> print(type(response)) # <class 阅读全文
posted @ 2021-08-03 11:01 该显示昵称已被使用了 阅读(39) 评论(0) 推荐(0)
摘要:# 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')) 阅读全文
posted @ 2020-10-19 21:28 该显示昵称已被使用了 阅读(208) 评论(0) 推荐(0)