![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python3
文若书生
这个作者很懒,什么都没留下…
展开
-
Python3 paramiko 实现ssh远程自动文件更新
1. 使用paramiko 库2. 实现sftp 文件上传3. 实现ssh 通过root 权限执行命令import osimport paramikoimport time# hostname = "10.0.0.99"# username = "liantong"# password = "liantong123"def upload_files(hostname, username, password, files): # http_daemon_file =原创 2021-12-29 18:01:48 · 864 阅读 · 0 评论 -
PyQt5 实现类似海康的设备搜索工具
简述 使用IP地址组播技术,实现海康的设备搜索功能,只要设备接入局域网就能够被搜索到。效果图.功能代码:1.scan_device_ui.py 布局文件# -*- coding: utf-8 -*-# Form implementation generated from reading ui file 'scan_device.ui'## Created by: PyQt5 UI code generator 5.15.2## WARNING: Any...原创 2021-09-10 15:33:08 · 759 阅读 · 0 评论 -
Python MC协议操作三菱PLCDemo
import HslCommunicationfrom HslCommunication import SoftBasic, MelsecMcNet, MelsecMcAsciiNet, MelsecA1ENet, SiemensS7Net, SiemensPLCS, \ SiemensFetchWriteNet, OmronFinsNet, ModbusTcpNet, OperateResult, NetSimplifyClientimport threadingimport time.原创 2021-07-19 09:49:49 · 3114 阅读 · 1 评论 -
Python3 PyAV 解析Rtsp流显示和保存为mp4文件
本文使用pyav解析视频流并且保存为mp4,详见代码。使用opencv的VideoWriter保存的mp4编码有问题不能在web端使用H5播放器进行播放。所以采用pyav来实现录像功能。import avimport cv2# rtsp 是标准的海康威视3级子码流video = av.open('rtsp://admin:haifan123@10.0.0.69:554/Streaming/Channels/103')print("format:" , video.dump...原创 2020-07-23 17:27:59 · 4587 阅读 · 1 评论 -
Python3 Opencv2 拼接两张图像
1. 纵向拼接import cv2import numpy as npimport pandas as pdimg1 = cv2.imread('E:\\tmp\\xray\\1.png')img2 = cv2.imread('E:\\tmp\\xray\\1_out.png')img1 = cv2.resize(img1, (640, 480))img2 = cv2.res...原创 2020-04-13 14:51:48 · 8334 阅读 · 0 评论 -
Boost.python3 C++ overloads 函数和类成员函数重载
参考官方文档https://www.boost.org/doc/libs/1_72_0/libs/python/doc/html/tutorial/tutorial/functions.html#tutorial.functions.overloading1.test.cpp#include <boost/python.hpp>#include <set&...原创 2020-03-13 16:32:57 · 382 阅读 · 0 评论 -
Boost.python3 C++ 返回tuple
参考官方文档https://www.boost.org/doc/libs/1_72_0/libs/python/doc/html/reference/object_wrappers/boost_python_tuple_hpp.html实际编写的代码:1. test_tuple.cpp#include <boost/python.hpp>#include <set...原创 2020-03-13 13:02:27 · 544 阅读 · 0 评论 -
Python3 Opencv 读取网络图片
from urllib import requestimport numpy as npimport cv2resp = request.urlopen("http://jy.haifandata.com:8881/img/tj.jpg")image = np.asarray(bytearray(resp.read()), dtype="uint8")image = cv2.imde...原创 2020-03-13 11:22:41 · 1757 阅读 · 0 评论