<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[oklying的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/oklying</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; oklying]]></copyright><item><title><![CDATA[发送消息和QTableWidget]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/116023656</link><guid>https://blog.youkuaiyun.com/oklying/article/details/116023656</guid><author>oklying</author><pubDate>Thu, 22 Apr 2021 17:42:04 +0800</pubDate><description><![CDATA[发送消息和QTableWidget
发送消息
1.创建消息类
from PyQt5.Qt import QObject
from PyQt5.QtCore import pyqtSignal

class SignalCenter(QObject):
    	login_succeed_signal = pyqtSignal(str, int)
        
signal_center = SignalCenter()

2.发送消息
signal_center.login_succeed_signa]]></description><category></category></item><item><title><![CDATA[界面切换]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115967718</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115967718</guid><author>oklying</author><pubDate>Wed, 21 Apr 2021 17:49:10 +0800</pubDate><description><![CDATA[界面切换
界面切换
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QStackedLayout, QLabel, QPushButton


class One(QWidget):
    def __init__(self):
        super(One, self).__init__()
        self.create_ui()

    def create_ui(self):
        label =]]></description><category></category></item><item><title><![CDATA[事件与页面切换]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115914692</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115914692</guid><author>oklying</author><pubDate>Tue, 20 Apr 2021 17:47:37 +0800</pubDate><description><![CDATA[事件与页面切换
控件事件绑定
import sys
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtWidgets import QPushButton, QLineEdit, QSpinBox

事件绑定三要素： xxx发生xx就做xx
事件源 发生 事件 就 执行某个操作(事件驱动程序)
绑定程序：事件源.事件.connect(操作对应的函数)
class MainWindow(QWidget):
    def __init]]></description><category></category></item><item><title><![CDATA[事务和索引、pymysql]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115736319</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115736319</guid><author>oklying</author><pubDate>Thu, 15 Apr 2021 19:38:45 +0800</pubDate><description><![CDATA[事务和索引、pymysql
事务
如果sql语句没有在事务环境下执行，那么sql的执行情况：如果sql执行成功，那么多应的操作就成功，如果sql执行失败，对应的操作就失败
– 如果sql语句在事务环境下执行，执行成功后，如果不提交操作会失败
– begin;   - 开启事务环境
– commit;  - 提交事务环境中sql (执行成功的sql提交才有效)
– rollback;  - 让事务环境中执行sql的功能失效（让数据库的状态会到事务环境中sql执行之前
begin;
commit;
rollba]]></description><category></category></item><item><title><![CDATA[子查询、连表查询、DCL、视图使用]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115708694</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115708694</guid><author>oklying</author><pubDate>Wed, 14 Apr 2021 20:37:25 +0800</pubDate><description><![CDATA[子查询、连表查询、DCL、视图使用
子查询
– 将一个查询的结果作为另外一个查询的条件或者查询对象
– 用法一：将一个查询结果作为另外一个查询的条件
-- 获取分数最高的学生的学号 
-- select max(score) from tb_record;
select sid from tb_record where score=(select max(score) from tb_record);

-- 获取分数大于90分的学生姓名 
-- select distinct sid from tb_re]]></description><category></category></item><item><title><![CDATA[外键约束和查询进阶]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115676337</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115676337</guid><author>oklying</author><pubDate>Tue, 13 Apr 2021 19:30:52 +0800</pubDate><description><![CDATA[外键约束和查询进阶
外键约束
– 1.添加和删除约束
– 1)添加和删除普通约束  - 唯一约束
– 添加约束: alter table 表名 add constraint 约束名 约束(字段);
use school;
alter table tb_teacher add constraint name_unique unique(tea_name);
– 删除约束
alter table tb_teacher drop constraint name_unique;
– 2）添加和删除外键约束
– E.]]></description><category></category></item><item><title><![CDATA[sql基础语法]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115637628</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115637628</guid><author>oklying</author><pubDate>Mon, 12 Apr 2021 19:49:18 +0800</pubDate><description><![CDATA[sql基础语法
– SQL(结构化查询语言) - 所有关系型数据库通用的语言
– DDL(数据定义语言) - create、drop、alter
– DML(数据操作语言) - insert、delete、update
– DQL(数据查询语言) - select
– DCL(数据控制语言) - grant、revoke
– 注意：SQL中不区分大小写；一条SQL语句结束必须加分号
– create = CREATE = CrEaTe

DDL

– 1)创建数据库: create database if ]]></description><category></category></item><item><title><![CDATA[ThreadAndProcess]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115530239</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115530239</guid><author>oklying</author><pubDate>Thu, 08 Apr 2021 20:17:49 +0800</pubDate><description><![CDATA[ThreadAndProcess
创建线程子类
from threading import Thread
from datetime import datetime
import time


class DownloadThread(Thread):
    def __init__(self, url):
        super().__init__()
        self.url = url

    def run(self) -&gt; None:
        # 确定需要在子线程中]]></description><category></category></item><item><title><![CDATA[pyqueryAndxPath]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115379906</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115379906</guid><author>oklying</author><pubDate>Thu, 01 Apr 2021 17:41:10 +0800</pubDate><description><![CDATA[pyqueryAndxPath
pyquery
from pyquery import PyQuery

pyquery是通过css选择器来获取网页中的标签
1.获取数据(只能是html界面)
with open('files/data.html', encoding='utf-8') as f:
    content = f.read()

2.创建PyQuery对象
html = PyQuery(content)

3.获取标签
直接在整个页面中按照css选择器获取指定标签
PyQuery对象(css]]></description><category></category></item><item><title><![CDATA[selenium]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115333845</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115333845</guid><author>oklying</author><pubDate>Tue, 30 Mar 2021 19:36:40 +0800</pubDate><description><![CDATA[selenium
selenium基本使用
from selenium.webdriver import Chrome
from selenium.webdriver.common.keys import Keys
import time


创建浏览器对象（谷歌）

wb = Chrome()


打开指定网页

wb.get('https://www.51job.com/')

3.获取当前浏览器中显示的页面的网页源代码
print(wb.page_source)

4.获取网页中的标签，并且操作标签
]]></description><category></category></item><item><title><![CDATA[selenium]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115333837</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115333837</guid><author>oklying</author><pubDate>Tue, 30 Mar 2021 19:36:05 +0800</pubDate><description><![CDATA[selenium
selenium基本使用
from selenium.webdriver import Chrome
from selenium.webdriver.common.keys import Keys
import time


创建浏览器对象（谷歌）

wb = Chrome()


打开指定网页

wb.get('https://www.51job.com/')

3.获取当前浏览器中显示的页面的网页源代码
print(wb.page_source)

4.获取网页中的标签，并且操作标签
]]></description><category></category></item><item><title><![CDATA[requets]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115309827</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115309827</guid><author>oklying</author><pubDate>Mon, 29 Mar 2021 20:03:56 +0800</pubDate><description><![CDATA[Requests
认识爬虫


爬虫基本步骤
爬虫就是通过代码取获取别人网站上的数据
1）获取网页数据 - requests和自动化测试工具(Selenium)
2）解析数据  -   正则表达式、css选择器、xpath
3）存储数据  -   表格文件(csv、openpyxl)和数据库文件


获取网页数据

认识网站
一个网页由三个部分组成：html、css、javascript(js)
html    -   决定网页中有什么
css     -   决定网页中内容的样式(长什么样)
js    ]]></description><category></category></item><item><title><![CDATA[面向对象进阶]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115253551</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115253551</guid><author>oklying</author><pubDate>Fri, 26 Mar 2021 19:25:35 +0800</pubDate><description><![CDATA[面向对象进阶
对象属性的增删改查
class Student:
    def __init__(self, name, gender='男', age=18, tel=''):
        self.name = name
        self.gender = gender
        self.age = age
        self.tel = tel

    def __repr__(self):
        return str(self.__dict__)


stu1 ]]></description><category></category></item><item><title><![CDATA[面向对象进阶]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115253537</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115253537</guid><author>oklying</author><pubDate>Fri, 26 Mar 2021 19:24:45 +0800</pubDate><description><![CDATA[面向对象进阶
对象属性的增删改查
class Student:
    def __init__(self, name, gender='男', age=18, tel=''):
        self.name = name
        self.gender = gender
        self.age = age
        self.tel = tel

    def __repr__(self):
        return str(self.__dict__)


stu1 ]]></description><category></category></item><item><title><![CDATA[面向对象基础]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115216424</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115216424</guid><author>oklying</author><pubDate>Thu, 25 Mar 2021 19:24:21 +0800</pubDate><description><![CDATA[面向对象基本
编程思想
1.面向过程编程(穷人思想)   -   逻辑+基本语法
print(10 + 20)

2.函数式编程（小资思想） -   函数+逻辑+基本语法
sum((10, 20))


def sum1(num1, num2):
    return num2 + num1

3.面向对象编程（富豪思想）- 类和对象 + 函数+逻辑+基本语法
类和对象
1.什么是类，什么是对象
类就是拥有相同属性和相同功能的对象的集合（抽象的）
对象是类的实例 （具体）
人类： 有名字、有年龄、有性别、有]]></description><category></category></item><item><title><![CDATA[面向对象基础]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115216407</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115216407</guid><author>oklying</author><pubDate>Thu, 25 Mar 2021 19:23:33 +0800</pubDate><description><![CDATA[面向对象基本
编程思想
1.面向过程编程(穷人思想)   -   逻辑+基本语法
print(10 + 20)

2.函数式编程（小资思想） -   函数+逻辑+基本语法
sum((10, 20))


def sum1(num1, num2):
    return num2 + num1

3.面向对象编程（富豪思想）- 类和对象 + 函数+逻辑+基本语法
类和对象
1.什么是类，什么是对象
类就是拥有相同属性和相同功能的对象的集合（抽象的）
对象是类的实例 （具体）
人类： 有名字、有年龄、有性别、有]]></description><category></category></item><item><title><![CDATA[正则]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115187482</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115187482</guid><author>oklying</author><pubDate>Wed, 24 Mar 2021 20:58:22 +0800</pubDate><description><![CDATA[正则
正则匹配字符

什么是正则（正则表达式）

正则是一种用来处理文本数据的一种工具。（一般用于处理复杂的文本问题）

正则的语法  -  用不同的符号来描述字符串规则


匹配类符号
检测类符号
控制次数的符号
分组和分支
其他常用参数

fullmatch(正则表达式, 字符串)  - 检测字符串是否符合正则表达式描述的规则，如果不符合返回None

匹配类符号  - 一个符号对应字符串的一个字符

1）普通字符 - 特殊符号以外的字符就是普通字符
普通字符在正则中表示这个符号本身
from re i]]></description><category></category></item><item><title><![CDATA[json和csv]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115024970</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115024970</guid><author>oklying</author><pubDate>Sat, 20 Mar 2021 11:39:49 +0800</pubDate><description><![CDATA[json和csv
二进制和字符串之间的转换
1.字符串(str)转二进制(bytes)
字符串转二进制
1)将字符串数据转换成二进制数据
str1 = 'abc'
b_str1 = b'abc'
print(type(str1), type(b_str1))     # &lt;class 'str'&gt; &lt;class 'bytes'&gt;

2)bytes(字符串)
str2 = 'hello'
result = bytes(str2, encoding='utf-8')
print(type]]></description><category></category></item><item><title><![CDATA[json和csv]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/115024943</link><guid>https://blog.youkuaiyun.com/oklying/article/details/115024943</guid><author>oklying</author><pubDate>Sat, 20 Mar 2021 11:38:24 +0800</pubDate><description><![CDATA[json和csv
二进制和字符串之间的转换
1.字符串(str)转二进制(bytes)
字符串转二进制
1)将字符串数据转换成二进制数据
str1 = 'abc'
b_str1 = b'abc'
print(type(str1), type(b_str1))     # &lt;class 'str'&gt; &lt;class 'bytes'&gt;

2)bytes(字符串)
str2 = 'hello'
result = bytes(str2, encoding='utf-8')
print(type]]></description><category></category></item><item><title><![CDATA[异常和文件操作]]></title><link>https://blog.youkuaiyun.com/oklying/article/details/114989691</link><guid>https://blog.youkuaiyun.com/oklying/article/details/114989691</guid><author>oklying</author><pubDate>Thu, 18 Mar 2021 20:21:50 +0800</pubDate><description><![CDATA[异常和文件操作
异常
1.异常  - 程序报错
当程序出现了异常，程序直接结束
print('=====')
# print('abc'[5])
print('-----')
print('+++++')

2.异常捕获
异常捕获就是让程序在出现异常的时候不崩溃还可以接着往后执行
1）语法1： - 捕获所有类型的异常
try:
代码段1（需要捕获异常的代码）
except:
代码段2（捕获到异常后会执行的代码）
finally:
代码段
其他代码
2）执行过程：先执行代码段1，如果代码段1在执行过程中出现了]]></description><category></category></item></channel></rss>