当前位置: 首页 > news >正文

做推广网站那里好/站长之家工具高清

做推广网站那里好,站长之家工具高清,凡客官网 电脑版,大学生网站建设例题答案📘 Day 18 🎉 本系列为Python基础学习,原稿来源于 30-Days-Of-Python 英文项目,大奇主要是对其本地化翻译、逐条验证和补充,想通过30天完成正儿八经的系统化实践。此系列适合零基础同学,或仅了解Python一点…

📘 Day 18

🎉 本系列为Python基础学习,原稿来源于 30-Days-Of-Python 英文项目,大奇主要是对其本地化翻译、逐条验证和补充,想通过30天完成正儿八经的系统化实践。此系列适合零基础同学,或仅了解Python一点知识,但又没有系统学习的使用者。总之如果你想提升自己的Python技能,欢迎加入《挑战30天学完Python》

  • 📘 Day 18
    • 正则表达式
      • re 模块
      • re 函数
        • match
        • search
        • findall
        • sub
        • split
    • 正则语法
      • 方括号 []
      • 转义 \
      • 一或多次 +
      • 任意字符 .
      • 零或多次 *
      • 零或一次 ?)
      • 数量 {}
      • 开头 ^
      • 不包含 [^]
    • 💻 第18天练习
      • 练习1级
      • 练习2级
      • 练习3级

正则表达式

正则表达式是一个特殊的字符序列,它能帮助你方便的检查一个字符串是否与某种模式匹配。要在python中使用RegEx,首先我们应该导入名为 re 的模块。

re 模块

导入模块以后,我们就可以使用它来检查或者查找了。

import re

re 函数

为了使用不同的模式进行查找, re 提供了一些函数方法来进行匹配。

  • re.match: 只在字符串的第一行开始搜索,如果找到则返回匹配的对象,否则返回None。
  • re.search: 如果字符串(包括多行字符串)中有匹配对象,则返回匹配对象。
  • re.findall: 返回包含所有匹配项的列表,如果没有匹配则返回空列表。
  • re.split: 方法按照能够匹配的子串将字符串分割后返回列表。
  • re.sub: 查找并替换一个或者多个匹配项。
Match
# 语法形式
match(pattern, string, flags=0)
# pattern: 匹配的正则表达式
# string:要匹配的字符串
# flags:[可选] 用来控制正则表达式的匹配方式,如:是否区分大小写,多行匹配等等
import retxt = 'I love to teach python and javaScript'
# 本身反馈一个 span 对象
match = re.match('I love to teach', txt, re.I)  # re.I 不区分大小写
print(match)  # <re.Match object; span=(0, 15), match='I love to teach'># 进一步我们可以使用span()获取匹配的起始位置和结束位置的元组值
span = match.span()
print(span)     # (0, 15)# 再进一步可以打印出拆分的起始和结束索引,以及使用分片获取匹配字符串
start, end = span
print(start, end)  # 0, 15
substring = txt[start:end]
print(substring)       # I love to teach

如例上边例子中示,我们在目标字符串中查找是否有 I love to teach 的字符串匹配。其中从开始的位置我们找到了对应匹配,进而得到了一个对象的返回。

import retxt = 'I love to teach python and javaScript'
match1 = re.match('I like to teach', txt, re.I)
print(match1)  # Nonematch2 = re.match('love', txt)
print(match2)  # None

此例子中字符串不包含 I like to teach,或者没用匹配开头字符,因此匹配方法返回None。

Search
# 语法
re.search(pattern, string, flags=0)
# 参数说明同match
import retxt = '''Python is the most beautiful language that a human being has ever created.
I recommend python for a first programming language'''# 返回匹配对象span
match = re.search('first', txt, re.I)
print(match)  # <re.Match object; span=(100, 105), match='first'># 获取匹配开始和结束位置元组
span = match.span()
print(span)     # (100, 105)# 获取开始和结束值,并获截取字字符串
start, end = span
print(start, end)  # 100 105
substring = txt[start:end]
print(substring)       # first# 没有任何匹配返回None
nom = re.search('weather', txt, re.I)
print(nom)  # None

正如你所见,搜索要比匹配方式好的多。因为它可以在整个文本中进行查找匹配。并返回第一找到的对象,否则返回None。接下来还有一个更好的函数 findall 它可以匹配所有并以列表形式返回。

findall

findall() 以列表的形式返回所有匹配

import retxt = '''Python is the most beautiful language that a human being has ever created.
I recommend python for a first programming language'''matches = re.findall('language', txt, re.I)
print(matches)  # ['language', 'language']

可以看到,单词 language 在字符串中出现了两次。现在我们将在字符串中寻找Python和Python单词:

txt = '''Python is the most beautiful language that a human being has ever created.
I recommend python for a first programming language'''# It returns list
matches = re.findall('python', txt, re.I)
print(matches)  # ['Python', 'python']

这个例子中因为我们使用标记位(re.I) 忽略大小写,所以返回两个。如果我们没有使用它,看看是什么结果。

import re
matches = re.findall('Python', txt)
print(matches)  # ['Python']

当然我们如果想要达到其他效果,也可以用其他方法,不过就没有上边使用标记位那么优雅了。

import re
txt = '''Python is the most beautiful language that a human being has ever created.
I recommend python for a first programming language'''matches = re.findall('Python|python', txt)
print(matches)  # ['Python', 'python']#
matches = re.findall('[Pp]ython', txt)
print(matches)  # ['Python', 'python']
sub

匹配并替换字符串,直接看例子:

import re
txt = '''Python is the most beautiful language that a human being has ever created.
I recommend python for a first programming language'''match_replaced = re.sub('Python|python', 'JavaScript', txt, re.I)
print(match_replaced)  # JavaScript is the most beautiful language that a human being has ever created.# 或者
match_replaced = re.sub('[Pp]ython', 'JavaScript', txt, re.I)
print(match_replaced)  # JavaScript is the most beautiful language that a human being has ever created.

让我们再来看一个例子。下边是一个包含很多多余 % 字符的字符串,让人晦涩难懂。让我们用此方法清楚掉它。

import re
txt = '''%I a%m te%%a%%che%r% a%n%d %% I l%o%ve te%ach%ing. 
T%he%re i%s n%o%th%ing as r%ewarding a%s e%duc%at%i%ng a%n%d e%m%p%ow%er%ing p%e%o%ple.
I fo%und te%a%ching m%ore i%n%t%er%%es%ting t%h%an any other %jobs. 
D%o%es thi%s m%ot%iv%a%te %y%o%u to b%e a t%e%a%cher?'''matches = re.sub('%', '', txt)
print(matches)

得到整洁的文本输出

I am teacher and  I love teaching. 
There is nothing as rewarding as educating and empowering people.
I found teaching more interesting than any other jobs.
Does this motivate you to be a teacher?
split

返回分割后的列表。

txt = '''I am teacher and  I love teaching.
There is nothing as rewarding as educating and empowering people.
I found teaching more interesting than any other jobs.
Does this motivate you to be a teacher?'''
print(re.split('\n', txt)) # 按照换行符 \n 进行分割返回# 其实等同于字符直接调用split方法
print(txt.split('\n'))  
['I am teacher and  I love teaching.', 'There is nothing as rewarding as educating and empowering people.', 'I found teaching more interesting than any other jobs.', 'Does this motivate you to be a teacher?']

正则语法

在以往我们声明一个变量,使用的是单引号或者双引号。如果要声明一个正则变量则是 r''
下面的模式仅用小写字母标识apple,为了使其不区分大小写,我们要么重写模式,要么添加一个标志。

import reregex_pattern = r'apple'
txt = 'Apple and banana are fruits. An old cliche says an apple a day a doctor way has been replaced by a banana a day keeps the doctor far far away. '
matches = re.findall(regex_pattern, txt)
print(matches)  # ['apple']# 添加标记位使其大小写不敏感
matches = re.findall(regex_pattern, txt, re.I)
print(matches)  # ['Apple', 'apple']# 或者我们使用一组规则匹配方法
regex_pattern = r'[Aa]pple'  # [Aa]表示匹配字符串首字符可以是大写A,也可以是小写a
matches = re.findall(regex_pattern, txt)
print(matches)  # ['Apple', 'apple']

这里先附上标记位包含哪些:

  • re.I:匹配对大小写不敏感
  • re.M:多行匹配(影响 ^ 和 $)
  • re.S:使 . 匹配包括换行在内的所有字符

然后就详细看下正则里的一些语法符

  • []: 一组字符
    • [a-c] 表示 a 或 b 或 c
    • [a-z] 表示 小写 a 到 z 任意字符
    • [A-Z] 表示 大写 A to Z 任意字符
    • [0-3] 表示 0 或 1 或 2 或 3
    • [0-9] 表示0 到 9 任意数字
    • [A-Za-z0-9] 表示任意单字符, 即 小写字母a到z, 大写字母A到Z 或数字0到9
  • \: 转义特殊字符
    • \d 表示 匹配任意数字,相当于 [0-9].
    • \D 表示 匹配任意非数字
  • . : 匹配任意字符(除了换行符 \n)
  • ^: 匹配开头
    • r’^substring’ 例如 r’^love’, 必须以love开头的句子
    • r’[^] 表示不在[]中的字符,例如 r’[^abc] 表示不是a, 不是b, 不是c。即除a,b,c之外的字符
  • $: 匹配结尾
    • r’substring ′ 举例 r ′ l o v e ' 举例 r'love 举例rlove’, 必须以love结尾的句子
  • *: 0或多个次
    • r’[a]*’ 表示可以不出现,或者可以出现多次
  • +: 0或多个次
    • r’[a]+’ 表示至少一次或多次
  • ?: 0或1次
    • r’[a]?’ 表示零次或一次
  • {n}:精确匹配个数
    • {3}: 表示 正好3个字符
    • {3,}: 表示 至少3个字符
    • {3,8}: 表示 3到8个字符
  • |: 不是就是(或)
    • r’apple|banana’ 表示要么是 apple 要么是 banana
  • (): 正则表达式分组并记住匹配的文本

在这里插入图片描述

让我们用一些例子来上边这些匹配字符是如何使用的。

方括号 []

让我们用方括号来匹配小写和大写

import reregex_pattern = r'[Aa]pple'
txt = 'Apple and banana are fruits. An old cliche says an apple a day a doctor way has been replaced by a banana a day keeps the doctor far far away.'
matches = re.findall(regex_pattern, txt)
print(matches)  # ['Apple', 'apple']

如我我们想再额外查找 banana,我们可以优化匹配如下:

import reregex_pattern = r'[Aa]pple|[Bb]anana' 
txt = 'Apple and banana are fruits. An old cliche says an apple a day a doctor way has been replaced by a banana a day keeps the doctor far far away.'
matches = re.findall(regex_pattern, txt)
print(matches)  # ['Apple', 'banana', 'apple', 'banana']

我们在方括号中使用了字符或 | ,因此设法提取出了 Apple, Apple, Banana 和 Banana。

转义 \

import reregex_pattern = r'\d'  # 
txt = 'This regular expression example was made on December 6,  2019 and revised on July 8, 2021'
matches = re.findall(regex_pattern, txt)
print(matches)  # ['6', '2', '0', '1', '9', '8', '2', '0', '2', '1'], 提取了所有数字,但这却不是我们想要的效果

一或多次 +

结合上边 \d 使用+做个组合优化

import reregex_pattern = r'\d+'  # d表示匹配数字, +表示一次或多次
txt = 'This regular expression example was made on December 6,  2019 and revised on July 8, 2021'
matches = re.findall(regex_pattern, txt)
print(matches)  # ['6', '2019', '8', '2021'] - 现在才是我们想要的效果

任意字符 .

import reregex_pattern = r'[a].'  # 小写a和任意
txt = '''Apple and banana are fruits'''
matches = re.findall(regex_pattern, txt)  # 匹配多个项目
print(matches)  # ['an', 'an', 'an', 'a ', 'ar'] 分别对应and中an,banana中an、an、a空格,are中ar regex_pattern = r'[a].+'  # . 任意字符, + 一次或多次(连续)
matches = re.findall(regex_pattern, txt)
print(matches)  # ['and banana are fruits']

零或多次 *

零次或多次。即可能不会出现,也可能多次出现。

import reregex_pattern = r'[a].*'
txt = '''Apple and banana are fruits'''
matches = re.findall(regex_pattern, txt)
print(matches)  # ['and banana are fruits']

零或一次 ?

零次或一次。即可能不会出现,也可能只出现一次。

import retxt = '''I am not sure if there is a convention how to write the word e-mail.
Some people write it as email others may write it as Email or E-mail.'''
regex_pattern = r'[Ee]-?mail'  # ? 表示 - 是个可选项
matches = re.findall(regex_pattern, txt)
print(matches)  # ['e-mail', 'email', 'Email', 'E-mail']

正则数量 {}

我们可以使用花括号指定我们在文本中寻找的子字符串的长度。让我们想一下,我们如果对一个长度为4个字符的子字符串感兴趣的话:

import retxt = '今年的大年三十日期是2023年1月23日,去年的则是2022年1月31日,真是一年比一年早'
regex_pattern = r'\d{4}'  # 精准匹配有四个数字的
matches = re.findall(regex_pattern, txt)
print(matches)  # ['2023', '2022']regex_pattern = r'\d{1,4}'   # 匹配1,2,3,4 贪婪模式
matches = re.findall(regex_pattern, txt)
print(matches)  # ['2023', '1', '23', '2022', '1', '31']

开头 ^

  • 匹配字符串的开头
import retxt = '今天天气很好,所以今天你的心情好吗?'
regex_pattern = r'^今天'  # ^ 表示必须以“今天”开头
matches = re.findall(regex_pattern, txt)
print(matches)  # ['今天'] 注意只返回了一个

不包含 [^]

import retxt = '今年的大年三十日期是2023年1月23日,去年的则是2022年1月31日,真是一年比一年早'
regex_pattern = r'[^\u4e00-\u9fa5, ]+'  # ^ 排除中文字符,逗号和空格
matches = re.findall(regex_pattern, txt)
print(matches)  # ['2023', '1', '23', '2022', '1', '31']

💻 第18天练习

练习1级

  1. 下面这段话中出现频率最高的单词是什么?
    paragraph = 'I love teaching. If you do not love teaching what else can you love. I love Python if you do not love something which can give you all the capabilities to develop an application what else can you love.
    [(6, 'love'),(5, 'you'),(3, 'can'),(2, 'what'),(2, 'teaching'),(2, 'not'),(2, 'else'),(2, 'do'),(2, 'I'),(1, 'which'),(1, 'to'),(1, 'the'),(1, 'something'),(1, 'if'),(1, 'give'),(1, 'develop'),(1, 'capabilities'),(1, 'application'),(1, 'an'),(1, 'all'),(1, 'Python'),(1, 'If')]
  1. 从以下这段对话中提取数字 “The position of some particles on the horizontal x-axis are -12, -4, -3 and -1 in the negative direction, 0 at origin, 4 and 8 in the positive direction.” 并计算出最远距离点。
points= ['-12', '-4', '-3', '-1', '0', '4', '8']
sorted_points= [-12, -4, -3, -1, 0, 4, 8]
distance = |-12| + |8|  # 20

练习2级

  1. 编写一个方法来识别字符串是否是有效的python变量
    is_valid_variable('first_name') # True
    is_valid_variable('first-name') # False
    is_valid_variable('1first_name') # False
    is_valid_variable('firstname') # True
    

练习3级

  1. 清除以下文本无用的字符。且统计出优化后的文本中出现频率最高的三个单词。

    sentence = '''%I $am@% a %tea@cher%, &and& I lo%#ve %tea@ching%;. There $is nothing; &as& mo@re rewarding as educa@ting &and& @emp%o@wering peo@ple. ;I found tea@ching m%o@re interesting tha@n any other %jo@bs. %Do@es thi%s mo@tivate yo@u to be a tea@cher!?'''print(clean_text(sentence))
    I am a teacher and I love teaching There is nothing as more rewarding as educating and empowering people I found teaching more interesting than any other jobs Does this motivate you to be a teacher
    print(most_frequent_words(cleaned_text)) # [(3, 'I'), (2, 'teaching'), (2, 'teacher')]
    

练习参考答案请移步 github项目地址 18_exercise.py

<< Day 17 | Day 19 >>

相关文章:

挑战30天学完Python:Day18 正则表达式

&#x1f4d8; Day 18 &#x1f389; 本系列为Python基础学习&#xff0c;原稿来源于 30-Days-Of-Python 英文项目&#xff0c;大奇主要是对其本地化翻译、逐条验证和补充&#xff0c;想通过30天完成正儿八经的系统化实践。此系列适合零基础同学&#xff0c;或仅了解Python一点…...

力扣● 343. 整数拆分 ● 96.不同的二叉搜索树

● 343. 整数拆分 想不到&#xff0c;要勇于看题解。 关键在于理解递推公式。 1、DP数组及其下标的含义&#xff1a;dp[i]是分解i这个数得到的最大的乘积。 2、DP数组如何初始化&#xff1a;dp[0]和dp[1]都没意义&#xff0c;所以直接不赋值&#xff0c;初始化dp[2]1即可。…...

游戏同步+游戏中的网络模块

原文链接&#xff1a;游戏开发入门&#xff08;九&#xff09;游戏同步技术_游戏数据同步机制流程怎么开发-CSDN博客 游戏开发入门&#xff08;十&#xff09;游戏中的网络模块_游戏开发组网-CSDN博客 3.同步技术的基本常识&#xff1a; a.同步给谁&#xff1f;某个用户&…...

【03】逆序数组

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 目录 一、逆序函数是什么&#xff1f; 二、逆序函数原码 1.直接逆序 2.创建临时数组逆序 三、结言 &#x1f4a5;一、逆序函数是什么&#xff1f; 示例&#xff1a;输入1 4 …...

基于Prony算法的系统参数辨识matlab仿真

目录 1.程序功能描述 2.测试软件版本以及运行结果展示 3.核心程序 4.本算法原理 5.完整程序 1.程序功能描述 Prony算法是一种用于信号处理和系统辨识的经典方法&#xff0c;特别适用于线性时不变系统&#xff08;LTI&#xff09;的频率响应分析以及模拟复指数信号序列。其…...

创建第一个React项目

React脚手架 npx create-react-app react-demonpx是直接从互联网网上拉最新的脚手架进行创建react 运行React项目 npm start若想找到Webpack配置文件 npm ejectReact的基本使用 基本步骤 导入react和react-dom vue 创建react元素 渲染react元素到页面中导入 import React…...

Redis篇之Redis持久化的实现

持久化即把数据保存到可以永久保存的存储设备当中&#xff08;磁盘&#xff09;。因为Redis是基于内存存储数据的&#xff0c;一旦redis实例当即数据将会全部丢失&#xff0c;所以需要有某些机制将内存中的数据持久化到磁盘以备发生宕机时能够进行恢复&#xff0c;这一过程就称…...

dpdk环境搭建和工作原理

文章目录 1、DPDK环境搭建1.1、环境搭建1.2、编译DPDK 2、DPDK工作原理 1、DPDK环境搭建 1.1、环境搭建 工具准备&#xff1a;VMware、ubuntu16.04。 &#xff08;1&#xff09;VMware添加两个网卡。桥接网卡作为 DPDK 运行的网卡&#xff0c;NAT 网卡作为 ssh 连接的网卡。 …...

接口测试实战--自动化测试流程

一、项目前期准备 常见项目软件架构: springMvc:tomcat里运行war包(在webapps目录下) springboot:java -jar xx.jar -xms(**) 运行参数 springCloud:k8s部署,使用kubectl create -f xx.yaml 接口自动化测试介入需越早越好,只要api定义好就可以编写自动化脚本; 某个…...

babylonjs中文文档

经过咨询官方&#xff0c;文档已经添加了开源协议。 基于目前babylonjs没有中文文档&#xff0c;为了打造更好的babylonjs生态圈 &#xff0c;特和小伙伴们翻译了官方文档。 相关链接: 欢迎加群&#xff1a;464146715 官方文档 中文文档 Babylonjs案例分享...

WordPress使用

WordPress功能菜单 仪表盘 可以查看网站基本信息和内容。 文章 用来管理文章内容&#xff0c;分类以及标签。编辑文章以及设置分类标签&#xff0c;分类和标签可以被添加到 外观-菜单 中。 分类名称自定义&#xff1b;别名为网页url链接中的一部分&#xff0c;最好别设置为中文…...

IDEA 2021.3激活

1、打开idea&#xff0c;在设置中查找Settings/Preferences… -> Plugins 内手动添加第三方插件仓库地址&#xff1a;https://plugins.zhile.io搜索&#xff1a;IDE Eval Reset 插件进行安装。应用和使用&#xff0c;如图...

进度条小程序

文章目录 铺垫回车换行缓冲区概述强制冲刷缓冲区 简单实现倒计时功能进度条小程序版本一实例代码效果展示分析 版本二 铺垫 回车换行 回车和换行是两个独立的动作 回车是将光标移动到当前行的最开始&#xff08;最左侧&#xff09; 换行是竖直向下平移一行 在C语言中&…...

K8S安装部署

常见的K8S安装部署方式 Minikube Minikube是一个工具&#xff0c;可以在本地快速运行一个单节点微型K8S&#xff0c;仅用于学习、预览K8S的一些特性使用。 部署地址&#xff1a;Install Tools | Kubernetes Kubeadm Kubeadm也是一个工具&#xff0c;提供kubeadm init和kube…...

AI大模型与小模型之间的“脱胎”与“反哺”(第一篇)

一、AI小模型脱胎于AI大模型&#xff0c;而AI小模型群又可以反哺AI大模型 AI大模型&#xff08;如GPT、BERT等&#xff09;通常拥有大量的参数和训练数据&#xff0c;能够生成或理解复杂的文本内容。这些大模型在训练完成后&#xff0c;可以通过剪枝、微调等方式转化为小模型&…...

C#学习总结

1、访问权限 方法默认访问修饰符&#xff1a;private 类默认访问修饰符&#xff1a;internal 类的成员默认访问修饰符&#xff1a;private 2、UserControl的使用 首先添加用户控件 使用时一种是通过代码添加&#xff0c;一种是通过拖动组件到xaml中...

计算机网络-网络互联

文章目录 网络互联网络互联方法LAN-LAN&#xff1a;网桥及其互连原理使用网桥实现LAN-LAN使用交换机扩展局域网使用路由器连接局域网 LAN-WANWAN-WAN路由选择算法非自适应路由选择算法自适应路由选择算法广播路由选择算法&#xff1a;分层路由选择算法 网络互联 网络互联是指利…...

免费的ChatGPT网站( 7个 )

ChatGPT 是由 OpenAI 公司研发的一款大型语言模型&#xff0c;它可以实现智能聊天、文本生成、语言翻译等多种功能。以下是 ChatGPT 的详细介绍&#xff1a; 智能聊天&#xff1a;ChatGPT 可以与用户进行自然语言对话&#xff0c;回答用户的问题&#xff0c;提供相关的信息和建…...

Opencv3.2 ubuntu20.04安装过程

##1、更新源 sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main" sudo apt update##2、安装依赖库 sudo apt-get install build-essential sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavfor…...

OpenGL ES (OpenGL) Compute Shader 计算着色器是怎么用的?

OpenGL ES (OpenGL) Compute Shader 是怎么用的? Compute Shader 是 OpenGL ES(以及 OpenGL )中的一种 Shader 程序类型,用于在GPU上执行通用计算任务。与传统的顶点着色器和片段着色器不同,Compute Shader 被设计用于在 GPU 上执行各种通用计算任务,而不是仅仅处理图形…...

Python爬虫进阶:爬取在线电视剧信息与高级检索

简介&#xff1a; 本文将向你展示如何使用Python创建一个能够爬取在线电视剧信息的爬虫&#xff0c;并介绍如何实现更高级的检索功能。我们将使用requests和BeautifulSoup库来爬取数据&#xff0c;并使用pandas库来处理和存储检索结果。 目录 一、爬取在线电视剧信息 …...

Floor报错原理详解+sql唯一约束性

目录 floor报错原理 唯一性约束 主键约束&#xff1a; 创建约束的形式 删除约束 删除唯一性约束&#xff08;UNIQUE Constraint&#xff09; 在SQL Server中&#xff1a; 在MySQL中&#xff1a; 在PostgreSQL中&#xff1a; 删除主键约束&#xff1a; floor报错原理 …...

Arduino中安装ESP32网络抽风无法下载 暴力解决办法 python

不知道什么仙人设计的arduino连接网络部分&#xff0c;死活下不下来。&#xff08;真的沙口&#xff0c;第一次看到这么抽风的下载口&#xff09; 操作 给爷惹火了我踏马解析json选zip直接全部下下来 把这个大家的开发板管理地址下下来跟后面python放在同一目录下&#xff0c…...

Linux基础命令—系统服务

基础知识 centos系统的开机流程 1)通电 2)BIOS硬件检查 3)MBR引导记录 mbr的引导程序 加载引导程序 让硬件加载操作系统内核 MBR在第一个磁盘第一个扇区 总大小512字节 mbr: 1.引导程序: 占用446字节用于引导硬件,加载引导程序 2.分区表: 总共占…...

qt-动画圆圈等待-LED数字

qt-动画圆圈等待-LED数字 一、演示效果二、关键程序三、下载链接 一、演示效果 二、关键程序 #include "LedNumber.h" #include <QLabel>LEDNumber::LEDNumber(QWidget *parent) : QWidget(parent) {//设置默认宽高比setScale((float)0.6);//设置默认背景色se…...

SpringBoot3整合Swagger3,访问出现404错误问题(未解决)

秉承着能用就用新的的理念&#xff0c;在JDK、SpringBoot、SpringCloud版本的兼容性下&#xff0c;选择了Java17、SpringBoot3.0.2整合Swagger3。 代码编译一切正常&#xff0c;Swagger的Bean也能加载&#xff0c;到了最后访问前端页面swagger-ui的时候出现404。 根据网上资料…...

Django配置文件参数详解

Django是一个高级的Python Web框架&#xff0c;它遵循MVC设计模式&#xff0c;并内置了许多功能&#xff0c;如认证、URL路由、模板引擎、对象关系映射&#xff08;ORM&#xff09;等。为了定制Django项目的各种功能和行为&#xff0c;我们需要编辑其配置文件。Django的主要配置…...

Docker+Kafka+Kafka-ui安装与配置

前言 Docker、Kafka都是开发中常用到的组件。在自己的第三台电脑上去安装这些…所以写个博客记录一下安装过程。本文主要内容&#xff1a;Docker安装、kafka安装、kafka可视化配置。这次的电脑环境是Windows11&#xff0c;Intel处理器。 Docker安装 https://www.docker.com/p…...

单例模式的介绍

单例模式&#xff08;Singleton&#xff09;是一种创建型设计模式&#xff0c;它确保一个类只有一个实例&#xff0c;并提供全局访问点。其核心思想是通过限制类的实例化次数&#xff0c;防止多个实例同时存在&#xff0c;从而避免了多线程竞争和资源浪费&#xff0c;提高了代码…...

JavaSec 基础之 XXE

文章目录 XMLReaderSAXReaderSAXBuilderDocumentBuilderUnmarshaller**SAXParserFactory**XMLReaderFactoryDigester总结 XMLReader public String XMLReader(RequestBody String content) {try {XMLReader xmlReader XMLReaderFactory.createXMLReader();// 修复&#xff1a…...