Pyqt QCustomPlot 简介、安装与实用代码示例(二)

目录

  • 前言
  • 实用代码示例
    • 彩色图演示
    • 散点像素图演示
    • 实时数据演示
    • 多轴演示
    • 对数轴演示
  • 结语

所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 nixgnauhcuy’s blog!

如需转载,请标明出处!

完整代码我已经上传到 Github 上了,可前往 https://github.com/nixgnauhcuy/QCustomPlot_Pyqt_Study 获取。
完整文章路径:

  • Pyqt QCustomPlot 简介、安装与实用代码示例(一) | nixgnauhcuy
  • Pyqt QCustomPlot 简介、安装与实用代码示例(二) | nixgnauhcuy
  • Pyqt QCustomPlot 简介、安装与实用代码示例(三) | nixgnauhcuy
  • Pyqt QCustomPlot 简介、安装与实用代码示例(四) | nixgnauhcuy

前言

继上文,继续补充官方示例 demo 实现~

实用代码示例

彩色图演示

A 2D color map with color scale. Color scales can be dragged and zoomed just like axes

import sys, mathfrom PyQt5.QtWidgets import QApplication, QGridLayout, QWidget
from QCustomPlot_PyQt5 import QCustomPlot, QCPAxis, QCPColorScale, QCPColorMap
from QCustomPlot_PyQt5 import QCPColorGradient, QCPMarginGroup, QCP, QCPRangeclass MainForm(QWidget):def __init__(self) -> None:super().__init__()self.setWindowTitle("彩色地图演示")self.resize(600,400)self.customPlot = QCustomPlot(self)self.gridLayout = QGridLayout(self).addWidget(self.customPlot)# configure axis rect:self.customPlot.setInteractions(QCP.Interactions(QCP.iRangeDrag | QCP.iRangeZoom)) # this will also allow rescaling the color scale by dragging/zoomingself.customPlot.axisRect().setupFullAxesBox(True)self.customPlot.xAxis.setLabel("x")self.customPlot.yAxis.setLabel("y")# set up the QCPColorMap:self.colorMap = QCPColorMap(self.customPlot.xAxis, self.customPlot.yAxis)nx = 200ny = 200self.colorMap.data().setSize(nx, ny) # we want the color map to have nx * ny data pointsself.colorMap.data().setRange(QCPRange(-4, 4), QCPRange(-4, 4)) # and span the coordinate range -4..4 in both key (x) and value (y) dimensions# now we assign some data, by accessing the QCPColorMapData instance of the color map:x, y, z = 0, 0, 0for xIndex in range(nx):for yIndex in range(ny):x, y =self.colorMap.data().cellToCoord(xIndex, yIndex)r = 3*math.sqrt(x*x+y*y)+1e-2z = 2*x*(math.cos(r+2)/r-math.sin(r+2)/r) # the B field strength of dipole radiation (modulo physical constants)self.colorMap.data().setCell(xIndex, yIndex, z)# add a color scale:self.colorScale = QCPColorScale(self.customPlot)self.customPlot.plotLayout().addElement(0, 1, self.colorScale) # add it to the right of the main axis rectself.colorScale.setType(QCPAxis.atRight) # scale shall be vertical bar with tick/axis labels right (actually atRight is already the default)self.colorMap.setColorScale(self.colorScale) # associate the color map with the color scaleself.colorScale.axis().setLabel("Magnetic Field Strength")# set the color gradient of the color map to one of the presets:self.colorMap.setGradient(QCPColorGradient(QCPColorGradient.gpPolar))# we could have also created a QCPColorGradient instance and added own colors to# the gradient, see the documentation of QCPColorGradient for what's possible.self.colorMap.rescaleDataRange() # make sure the axis rect and color scale synchronize their bottom and top margins (so they line up):marginGroup = QCPMarginGroup(self.customPlot)self.customPlot.axisRect().setMarginGroup(QCP.msBottom|QCP.msTop, marginGroup)self.colorScale.setMarginGroup(QCP.msBottom|QCP.msTop, marginGroup)# rescale the key (x) and value (y) axes so the whole color map is visible:self.customPlot.rescaleAxes()if __name__ == '__main__':app = QApplication(sys.argv)mainForm = MainForm()mainForm.show()sys.exit(app.exec())

在这里插入图片描述

散点像素图演示

Pixmap scatter points and a multi-lined axis label, as well as a plot title at the top

import sysfrom PyQt5.QtWidgets import QApplication, QGridLayout, QWidget
from PyQt5.QtGui import QPen, QColor, QFont, QBrush, QPixmap
from PyQt5.QtCore import Qtfrom QCustomPlot_PyQt5 import QCustomPlot, QCPTextElement, QCPScatterStyle, QCPGraphclass MainForm(QWidget):def __init__(self) -> None:super().__init__()self.setWindowTitle("散点像素图演示")self.resize(600,400)self.customPlot = QCustomPlot(self)self.gridLayout = QGridLayout(self).addWidget(self.customPlot)self.customPlot.axisRect().setBackground(QColor(0, 0, 0))self.customPlot.addGraph()self.customPlot.graph().setLineStyle(QCPGraph.lsLine)pen = QPen(QColor(255, 200, 20, 200))pen.setStyle(Qt.DashLine)pen.setWidthF(2.5)self.customPlot.graph().setPen(pen)self.customPlot.graph().setBrush(QBrush(QColor(255,200,20,70)))self.customPlot.graph().setScatterStyle(QCPScatterStyle(QPixmap("./tmp.png")))# set graph name, will show up in legend next to icon:self.customPlot.graph().setName("Data from Photovoltaic\nenergy barometer 2011")# set data:year = [2005, 2006, 2007, 2008, 2009, 2010, 2011]value = [2.17, 3.42, 4.94, 10.38, 15.86, 29.33, 52.1]self.customPlot.graph().setData(year, value)# set title of plot:self.customPlot.plotLayout().insertRow(0)self.customPlot.plotLayout().addElement(0, 0, QCPTextElement(self.customPlot, "Regenerative Energies", QFont("sans", 12, QFont.Bold)))# axis configurations:self.customPlot.xAxis.setLabel("Year")self.customPlot.yAxis.setLabel("Installed Gigawatts of\nphotovoltaic in the European Union")self.customPlot.xAxis2.setVisible(True)self.customPlot.yAxis2.setVisible(True)self.customPlot.xAxis2.setTickLabels(False)self.customPlot.yAxis2.setTickLabels(False)self.customPlot.xAxis2.setTicks(False)self.customPlot.yAxis2.setTicks(False)self.customPlot.xAxis2.setSubTicks(False)self.customPlot.yAxis2.setSubTicks(False)self.customPlot.xAxis.setRange(2004.5, 2011.5)self.customPlot.yAxis.setRange(0, 52)# setup legend:self.customPlot.legend.setFont(QFont(self.font().family(), 7))self.customPlot.legend.setIconSize(50, 20)self.customPlot.legend.setVisible(True)self.customPlot.axisRect().insetLayout().setInsetAlignment(0, Qt.AlignLeft | Qt.AlignTop)if __name__ == '__main__':app = QApplication(sys.argv)mainForm = MainForm()mainForm.show()sys.exit(app.exec())

在这里插入图片描述

官方 demo 的背景图我没有,随便用黑色底了,太阳 logo 也没有,随便找了一个,效果一样就行~

实时数据演示

Real time generated data and time bottom axis

import sys, math, randomfrom PyQt5.QtWidgets import QApplication, QGridLayout, QWidget
from PyQt5.QtGui import QPen, QColor
from PyQt5.QtCore import Qt, QTime, QTimerfrom QCustomPlot_PyQt5 import QCustomPlot, QCPAxisTickerTimeclass MainForm(QWidget):def __init__(self) -> None:super().__init__()self.setWindowTitle("实时数据演示")self.resize(600,400)self.lastPointKey = 0self.customPlot = QCustomPlot(self)self.gridLayout = QGridLayout(self).addWidget(self.customPlot)self.customPlot.addGraph()self.customPlot.graph(0).setPen(QPen(QColor(40, 110, 255)))self.customPlot.addGraph()self.customPlot.graph(1).setPen(QPen(QColor(255, 110, 40)))timeTicker = QCPAxisTickerTime()timeTicker.setTimeFormat("%h:%m:%s")self.customPlot.xAxis.setTicker(timeTicker)self.customPlot.axisRect().setupFullAxesBox()self.customPlot.yAxis.setRange(-1.2, 1.2)# make left and bottom axes transfer their ranges to right and top axes:self.customPlot.xAxis.rangeChanged.connect(self.customPlot.xAxis2.setRange)self.customPlot.yAxis.rangeChanged.connect(self.customPlot.yAxis2.setRange)# setup a timer that repeatedly calls MainWindow::realtimeDataSlot:self.curTime = QTime.currentTime()self.dataTimer = QTimer(self)self.dataTimer.timeout.connect(self.realtimeDataSlot)self.dataTimer.start(0) # Interval 0 means to refresh as fast as possibledef realtimeDataSlot(self) -> None:# calculate two new data points:key = self.curTime.msecsTo(QTime.currentTime())/1000.0if key-self.lastPointKey > 0.002: # at most add point every 2 ms# add data to lines:self.customPlot.graph(0).addData(key, math.sin(key)+random.random()*1*math.sin(key/0.3843))self.customPlot.graph(1).addData(key, math.cos(key)+random.random()*0.5*math.sin(key/0.4364))# rescale value (vertical) axis to fit the current data:# self.customPlot.graph(0).rescaleValueAxis()# self.customPlot.graph(1).rescaleValueAxis(True)self.lastPointKey = key# make key axis range scroll with the data (at a constant range size of 8):self.customPlot.xAxis.setRange(key, 8, Qt.AlignRight)self.customPlot.replot()if __name__ == '__main__':app = QApplication(sys.argv)mainForm = MainForm()mainForm.show()sys.exit(app.exec())

多轴演示

Multiple plot styles with different key/value axes and pi tick labeling at top axis

import sys, math, randomfrom PyQt5.QtWidgets import QApplication, QGridLayout, QWidget
from PyQt5.QtGui import QPen, QColor, QFont, QBrush
from PyQt5.QtCore import Qt, QLocale
from QCustomPlot_PyQt5 import QCustomPlot, QCPGraph, QCPScatterStyle, QCPTextElement, QCPAxisTickerPi, QCPErrorBarsclass MainForm(QWidget):def __init__(self) -> None:super().__init__()self.setWindowTitle("多轴演示")self.resize(600,400)self.customPlot = QCustomPlot(self)self.gridLayout = QGridLayout(self).addWidget(self.customPlot)self.customPlot.setLocale(QLocale(QLocale.English, QLocale.UnitedKingdom)) # period as decimal separator and comma as thousand separatorself.customPlot.legend.setVisible(True)legendFont = self.font()  # start out with MainWindow's font..legendFont.setPointSize(9) # and make a bit smaller for legendself.customPlot.legend.setFont(legendFont)self.customPlot.legend.setBrush(QBrush(QColor(255,255,255,230)))# by default, the legend is in the inset layout of the main axis rect. So this is how we access it to change legend placement:self.customPlot.axisRect().insetLayout().setInsetAlignment(0, Qt.AlignBottom|Qt.AlignRight)# setup for graph 0: key axis left, value axis bottom# will contain left maxwell-like functionself.customPlot.addGraph(self.customPlot.yAxis, self.customPlot.xAxis)self.customPlot.graph(0).setPen(QPen(QColor(255, 100, 0)))self.customPlot.graph(0).setLineStyle(QCPGraph.lsLine)self.customPlot.graph(0).setScatterStyle(QCPScatterStyle(QCPScatterStyle.ssDisc, 5))self.customPlot.graph(0).setName("Left maxwell function")# setup for graph 1: key axis bottom, value axis left (those are the default axes)# will contain bottom maxwell-like function with error barsself.customPlot.addGraph()self.customPlot.graph(1).setPen(QPen(Qt.red))self.customPlot.graph(1).setLineStyle(QCPGraph.lsStepCenter)self.customPlot.graph(1).setScatterStyle(QCPScatterStyle(QCPScatterStyle.ssCircle, Qt.red, Qt.white, 7))self.customPlot.graph(1).setName("Bottom maxwell function")errorBars = QCPErrorBars(self.customPlot.xAxis, self.customPlot.yAxis)errorBars.removeFromLegend()errorBars.setDataPlottable(self.customPlot.graph(1))# setup for graph 2: key axis top, value axis right# will contain high frequency sine with low frequency beating:self.customPlot.addGraph(self.customPlot.xAxis2, self.customPlot.yAxis2)self.customPlot.graph(2).setPen(QPen(Qt.blue))self.customPlot.graph(2).setName("High frequency sine")# setup for graph 3: same axes as graph 2# will contain low frequency beating envelope of graph 2self.customPlot.addGraph(self.customPlot.xAxis2, self.customPlot.yAxis2)blueDotPen = QPen(QColor(30, 40, 255, 150))blueDotPen.setStyle(Qt.DotLine)blueDotPen.setWidthF(4)self.customPlot.graph(3).setPen(blueDotPen)self.customPlot.graph(3).setName("Sine envelope")# setup for graph 4: key axis right, value axis top# will contain parabolically distributed data points with some random perturbanceself.customPlot.addGraph(self.customPlot.yAxis2, self.customPlot.xAxis2)self.customPlot.graph(4).setPen(QPen(QColor(50, 50, 50, 255)))self.customPlot.graph(4).setLineStyle(QCPGraph.lsNone)self.customPlot.graph(4).setScatterStyle(QCPScatterStyle(QCPScatterStyle.ssCircle, 4))self.customPlot.graph(4).setName("Some random data around\na quadratic function")# generate data, just playing with numbers, not much to learn here:x0 = [3*i/25.0 for i in range(25)]y0 = [math.exp(-x*x*0.8)*(x*x+x) for x in x0]self.customPlot.graph(0).setData(x0, y0)x1 = [3*i/15.0 for i in range(15)]y1 = [math.exp(-x*x)*(x*x)*2.6 for x in x1]y1err = [y*0.25 for y in y1]self.customPlot.graph(1).setData(x1, y1)errorBars.setData(y1err, y1err)x2 = [i/250.0*3*math.pi for i in range(250)]y2 = [math.sin(x*12)*math.cos(x)*10 for x in x2]self.customPlot.graph(2).setData(x2, y2)x3 = x2y3 = [math.cos(x)*10 for x in x3]self.customPlot.graph(3).setData(x3, y3)x4 = [i/250.0*100-50 for i in range(250)]y4 = [0.01*x*x + 1.5*(random.random()-0.5) + 1.5*math.pi for x in x4]self.customPlot.graph(4).setData(x4, y4)# activate top and right axes, which are invisible by default:self.customPlot.xAxis2.setVisible(True)self.customPlot.yAxis2.setVisible(True)# set ranges appropriate to show data:self.customPlot.xAxis.setRange(0, 2.7)self.customPlot.yAxis.setRange(0, 2.6)self.customPlot.xAxis2.setRange(0, 3.0*math.pi)self.customPlot.yAxis2.setRange(-70, 35)# set pi ticks on top axis:self.customPlot.xAxis2.setTicker(QCPAxisTickerPi())# add title layout element:self.customPlot.plotLayout().insertRow(0)self.customPlot.plotLayout().addElement(0, 0, QCPTextElement(self.customPlot, "Way too many graphs in one plot", QFont("sans", 12, QFont.Bold)))# set labels:self.customPlot.xAxis.setLabel("Bottom axis with outward ticks")self.customPlot.yAxis.setLabel("Left axis label")self.customPlot.xAxis2.setLabel("Top axis label")self.customPlot.yAxis2.setLabel("Right axis label")# make ticks on bottom axis go outward:self.customPlot.xAxis.setTickLength(0, 5)self.customPlot.xAxis.setSubTickLength(0, 3)# make ticks on right axis go inward and outward:self.customPlot.yAxis2.setTickLength(3, 3)self.customPlot.yAxis2.setSubTickLength(1, 1)if __name__ == '__main__':app = QApplication(sys.argv)mainForm = MainForm()mainForm.show()sys.exit(app.exec())

在这里插入图片描述

对数轴演示

Logarithmic axis scaling. Note correct display of the sine function crossing zero in negative infinity

import sys, mathfrom PyQt5.QtWidgets import QApplication, QGridLayout, QWidget
from PyQt5.QtGui import QPen, QColor, QBrush
from PyQt5.QtCore import Qt
from QCustomPlot_PyQt5 import QCustomPlot, QCPGraph, QCPGraphData, QCP, QCPAxis, QCPAxisTickerLogclass MainForm(QWidget):def __init__(self) -> None:super().__init__()self.setWindowTitle("对数轴演示")self.resize(600,400)self.customPlot = QCustomPlot(self)self.gridLayout = QGridLayout(self).addWidget(self.customPlot)self.customPlot.setNoAntialiasingOnDrag(True) # more performance/responsiveness during draggingself.customPlot.addGraph()pen = QPen(QColor(255,170,100))pen.setWidth(2)pen.setStyle(Qt.DotLine)self.customPlot.graph(0).setPen(pen)self.customPlot.graph(0).setName("x")self.customPlot.addGraph()self.customPlot.graph(1).setPen(QPen(Qt.red))self.customPlot.graph(1).setBrush(QBrush(QColor(255, 0, 0, 20)))self.customPlot.graph(1).setName("-sin(x)exp(x)")self.customPlot.addGraph()self.customPlot.graph(2).setPen(QPen(Qt.blue))self.customPlot.graph(2).setBrush(QBrush(QColor(0, 0, 255, 20)))self.customPlot.graph(2).setName(" sin(x)exp(x)")self.customPlot.addGraph ()pen = QPen(QColor(0,0,0))pen.setWidth(1)pen.setStyle(Qt.DashLine)self.customPlot.graph(3).setPen(pen)self.customPlot.graph(3).setBrush(QBrush(QColor(0,0,0,15)))self.customPlot.graph(3).setLineStyle(QCPGraph.lsStepCenter)self.customPlot.graph(3).setName("x!")dataCount = 200dataFactorialCount = 21dataLinear = [QCPGraphData() for i in range(dataCount)]dataMinusSinExp = [QCPGraphData() for i in range(dataCount)]dataPlusSinExp = [QCPGraphData() for i in range(dataCount)]dataFactorial = [QCPGraphData() for i in range(dataFactorialCount)]for i in range(dataCount):dataLinear[i].key = i/10.0dataLinear[i].value = dataLinear[i].keydataMinusSinExp[i].key = i/10.0dataMinusSinExp[i].value = -math.sin(dataMinusSinExp[i].key)*math.exp(dataMinusSinExp[i].key)dataPlusSinExp[i].key = i/10.0dataPlusSinExp[i].value = math.sin(dataPlusSinExp[i].key)*math.exp(dataPlusSinExp[i].key)for i in range(dataFactorialCount):dataFactorial[i].key = idataFactorial[i].value = 1.0for k in range(1, i+1):dataFactorial[i].value *= kself.customPlot.graph(0).data().set(dataLinear)self.customPlot.graph(1).data().set(dataMinusSinExp)self.customPlot.graph(2).data().set(dataPlusSinExp)self.customPlot.graph(3).data().set(dataFactorial)self.customPlot.xAxis.grid().setSubGridVisible(True)self.customPlot.yAxis.grid().setSubGridVisible(True)self.customPlot.yAxis.setScaleType(QCPAxis.stLogarithmic)self.customPlot.yAxis2.setScaleType(QCPAxis.stLogarithmic)logTicker = QCPAxisTickerLog()self.customPlot.yAxis.setTicker(logTicker)self.customPlot.yAxis2.setTicker(logTicker)self.customPlot.yAxis.setNumberFormat("eb") # e = exponential, b = beautiful decimal powersself.customPlot.yAxis.setNumberPrecision(0) # makes sure "1*10^4" is displayed only as "10^4"self.customPlot.xAxis.setRange(0, 19.9)self.customPlot.yAxis.setRange(1e-2, 1e10)# make range draggable and zoomable:self.customPlot.setInteractions(QCP.Interactions(QCP.iRangeDrag | QCP.iRangeZoom))# make top right axes clones of bottom left axes:self.customPlot.axisRect().setupFullAxesBox()# connect signals so top and right axes move in sync with bottom and left axes:self.customPlot.xAxis.rangeChanged.connect(self.customPlot.xAxis2.setRange)self.customPlot.yAxis.rangeChanged.connect(self.customPlot.yAxis2.setRange)self.customPlot.legend.setVisible(True)self.customPlot.legend.setBrush(QBrush(QColor(255,255,255,150)))self.customPlot.axisRect().insetLayout().setInsetAlignment(0, Qt.AlignLeft|Qt.AlignTop) # make legend align in top left corner or axis rectif __name__ == '__main__':app = QApplication(sys.argv)mainForm = MainForm()mainForm.show()sys.exit(app.exec())

在这里插入图片描述

结语

还剩下一些示例,待续篇更新!~

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/31656.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

智能自动化棋牌室小程序开发源码

开发一个智能自动化棋牌室小程序并获取其源码是一个涉及多个技术领域的复杂任务。下面是一个大致的开发流程和注意事项: 1. 技术选型 前端技术:使用微信小程序开发框架,如微信原生开发框架、Taro、Uni-app 等。后端技术:选择合适…

Class类--constructor构造函数

在JavaScript的类(Class)中,如果在 constructor(构造函数)里使用 ‘this.方法名()’,通常是用来在创建类的实例时立即调用某个方法,以完成一些初始化或设置操作。这种方式可以确保在对象创建时就…

建筑八大员之机械员精选试题

1.关于工程分包,以下说法正确的是(A)。 A.承包单位不得将其承包的全部工程肢解以后以分包的名义分别转包给他人 B.总承包单位将工程分包给不具备相应资质条件的单位 C.分包单位可以将其承包的工程再分包 D.总承包单位擅自将承包的部分工程发包给具有相应资质条件的分…

浅谈微服务架构中实现单点登录

随着微服务架构的广泛应用,如何在这种架构下实现单点登录(Single Sign-On, SSO)成为一个重要的问题。单点登录能够使用户在多个服务之间无缝访问,而不需要每次访问不同的服务时都重新进行身份验证。 这篇文章将详细介绍在微服务架…

工业级定制化智能硬件设备:塑造未来制造业的核心力量

在快速变化的工业环境中,企业面临着日益激烈的竞争和不断提高的效率需求。为了应对这些挑战,工业级定制化智能硬件设备成为了众多行业的首选。这类设备不仅提高了生产的灵活性和效率,还通过精准的数据收集和分析,为企业带来了前所…

鸿蒙文件操作事前准备

13900001,沙箱13900002 首选授权 module授权配置 "requestPermissions": [{ "name": "ohos.permission.CAMERA",}, { "name": "ohos.permission.READ_MEDIA",}, { "name": "ohos.permission.WR…

Python入门指南:从基础到高级

一、引言 1.1 Python编程语言简介 一、起源与发展 Python由荷兰计算机科学家吉多范罗苏姆(Guido van Rossum)于1990年代初设计,作为ABC语言的一种替代品。 1991年发布了Python的第一个版本(0.9.0)。 2000年发布了Py…

优化MySQL并发事务:如何避免更新丢失问题?

背景描述 现在有两个事务,事务A和事务B,他们都需要修改同一行数据,这行数据原始值为100,事务A的操作是数据增加100,事务B的操作也是增加100,预期的最终结果是300,现在如何保证最终的数据是300的…

【C++进阶学习】第三弹——菱形继承和虚拟继承——菱形继承的二义性和数据冗余问题

继承(上):【C进阶学习】第一弹——继承(上)——探索代码复用的乐趣-CSDN博客 继承(下):【C进阶学习】第二弹——继承(下)——挖掘继承深处的奥秘-CSDN博客 …

教育培训系统(FastAdmin+ThinkPHP+Unipp)

引领学习新风尚 📚 引言:教育新篇章 随着科技的不断发展,教育形式也在不断创新与变革。教育培训系统作为这一变革的重要载体,正逐渐改变着我们的学习方式。今天,就让我们一起探索教育培训系统的魅力,看看它…

雷池社区版自动SSL

正常安装雷池,并配置站点,暂时不配置ssl 不使用雷池自带的证书申请。 安装(acme.sh),使用域名验证方式生成证书 先安装git yum install git 或者 apt-get install git 安装完成后使用 git clone https://gitee.com/n…

[Linux内核驱动]导出符号

导出符号 更多详细内容可以查看我的github 在Linux内核中,导出符号(Exported symbols)是指内核模块可以访问的符号,这些符号通常是函数或变量。当内核模块需要调用内核中定义的函数或访问内核中定义的变量时,这些函数或…

【代码仓库提交大文件,用Git LFS!】

开始前 Git LFS:请注意,你的远程仓库需要支持Git LFS。GitHub、GitLab和Bitbucket都支持Git LFS,但可能需要额外的配置或开启特定的支持选项。 介绍 Git LFS (Large File Storage) 是一个 Git 扩展,用于处理和存储大文件。通常…

DVWA 靶场 Authorisation Bypass 通关解析

前言 DVWA代表Damn Vulnerable Web Application,是一个用于学习和练习Web应用程序漏洞的开源漏洞应用程序。它被设计成一个易于安装和配置的漏洞应用程序,旨在帮助安全专业人员和爱好者了解和熟悉不同类型的Web应用程序漏洞。 DVWA提供了一系列的漏洞场…

在寻找电子名片在线制作免费生成?5个软件帮助你快速制作电子名片

在寻找电子名片在线制作免费生成?5个软件帮助你快速制作电子名片 当你需要快速制作电子名片时,有几款免费在线工具可以帮助你实现这个目标。这些工具提供了丰富的设计模板和元素,让你可以轻松地创建个性化、专业水平的电子名片。 1.一键logo…

python 学习积累

持续更新中 感受python的强大之case列举: 1. 生成的map list要经过json格式化写入文件,请用python实现这一需求 import json map{"name": "张三", "age": 18, "address": "北京"} list[] for i in …

个人知识库(python/AI/机器学习/数据分析/神经网络/机器视觉/共享文档)

个人工作学习中总结的知识技巧,欢迎大家阅读学习,地址:语雀阅读地址 后期也会把资源在csdn上公布出来,方便同行借鉴.

探索C嘎嘎的奇妙世界:第十七关---STL(vector的模拟实现)

vector是一种动态数组,可以动态调整大小并按照索引访问元素。由于很多接口在string中都有所重复,所以这次来讲一些有所区别的接口 1. 迭代器 Vector中的迭代器是一种用于遍历vector中元素的对象。迭代器提供了一种访问vector中元素的统一方式&#xff0…

vue2.7支持组合式API,但是对应的vue-router3并不支持useRoute、useRouter。

最近在做一个项目,因为目标用户浏览器版本并不确定,可能会有较旧版本,于是采用vue2.7而不是vue3,最近一年多使用vue3开发的项目都碰到了很多chrome 63-73版本,而对应UI 库 element plus又问题很多。 为了不碰到这些问…

TCP 协议详解:三次握手与四次挥手

在网络通信中,确保数据准确无误地传递是至关重要的。TCP(Transmission Control Protocol,传输控制协议)作为一种面向连接的、可靠的、基于字节流的通信协议,在网络数据传输中起到了核心作用。本文将详细解析 TCP 的基本…