- 博客(6)
- 收藏
- 关注
原创 python利用opencv画图
import cv2import matplotlib.pyplot as pltimport numpy# img = cv2.imread("bb.png")##########opencv打开图片img = numpy.zeros((500,500,3),dtype="uint8")###构建全零矩阵###画线,其中(0,0)为起始点坐标,(500,300)为终止点坐标,# (255,0,0...
2018-05-17 10:10:31 771
原创 python使用PIL模块获取图片像素点
from PIL import Image########获取图片指定像素点的像素def getPngPix(pngPath = "aa.png",pixelX = 1,pixelY = 1): img_src = Image.open(pngPath) img_src = img_src.convert('RGBA') str_strlist = img_src.load() ...
2018-05-16 15:57:27 13442
原创 python 用matplotlib获取图片的大小
import timeimport matplotlib.image as mpingdef getPngSize(pngPath ="aa.png"): print("获取图片尺寸大小:"+ str(pngPath)) try: lena = mping.imread(pngPath) except: time.sleep(0.5) p...
2018-05-16 15:53:49 4462
原创 pyqt5 label 设置字体类型,颜色 ##设置label边框,label贴图
import sysfrom PyQt5.QtGui import *from PyQt5.QtWidgets import *class MyWindow(QWidget): #########此窗口已经不再使用 def __init__(self,parent = None): super(QWidget,self).__init__() self.se...
2018-05-16 14:32:22 27033 1
原创 python websocket模拟客户端
from websocket import create_connectionws = create_connection("ws://127.0.0.1:9002")ws.send("Hello, World")##发送消息result = ws.recv()##接收消息ws.close()
2018-05-15 17:14:37 9685
原创 python 字符串和字典互转,以及 python对象存入到文件,且读取
########dumps()和loads() 字典和字符串的相互转化import jsondict = {1:"a",2:"b",3:"c"}print(dict)str_dict = json.dumps(dict)print(str_dict)print(type(str_dict))dict = json.loads(str_dict)print(type(dict))print(di...
2018-05-15 16:58:29 2078 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人