12 2021 档案

摘要:文本属性: font-style字体样式风格: font-style属性值: - normal:设置字体样式为正体。默认值。 - italic:设置字体样式为斜体。这是选择字体库中的斜体字。 - oblique:设置字体样式为斜体。人为的使文字倾斜,而不是去使用字体库的斜体字。 font-weigh 阅读全文
posted @ 2021-12-31 10:18 咖啡馆 阅读(100) 评论(0) 推荐(0) 编辑
摘要:基本选择器: 标签名选择器:标签名{} id选择器:#id值{} class选择器:.class值{} 通配选择器:*{} <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <sty 阅读全文
posted @ 2021-12-30 14:23 咖啡馆 阅读(31) 评论(0) 推荐(0) 编辑
摘要:CSS就是Cascading Style Sheet的缩写,中文译作“层叠样式表”或者是“级联样式表”,是用于控制网页外观处理并允许将网页的表现与内容分离的一种标记性语言,CSS不需要编译,可以直接由浏览器执行(属于浏览器解释型语言),是Web网页开发技术的重要组成部分。 使用CSS样式可以有效地对 阅读全文
posted @ 2021-12-30 13:59 咖啡馆 阅读(77) 评论(0) 推荐(0) 编辑
摘要:本文主要是记录一些HTML中的语法使用; 推荐好用的链接:https://www.w3school.com.cn/index.html HTML标准结构: <!DOCTYPE html> <!--通知浏览器使用html来解析本文--> <html lang="en"> <!--文档的开始标记,该页面 阅读全文
posted @ 2021-12-29 16:54 咖啡馆 阅读(54) 评论(0) 推荐(0) 编辑
摘要:import re """从开始位置开始匹配,如果开头没有则无""" re.match """搜索整个字符串""" re.search """搜索整个字符串,返回一个list""" re.findall """用来提取符合匹配规则的分组截获的字符串""" re.group(): 参考:https:/ 阅读全文
posted @ 2021-12-27 17:30 咖啡馆 阅读(27) 评论(0) 推荐(0) 编辑
摘要:import datetime import time """获取当前时间时间戳""" print(time.time()) """获取当前时间:Mon Dec 27 14:00:06 2021""" print(time.strftime("%a %b %d %H:%M:%S %Y", time. 阅读全文
posted @ 2021-12-27 14:06 咖啡馆 阅读(36) 评论(0) 推荐(0) 编辑
摘要:说明: configparser模块是用来解析ini配置文件的解析器,可以包含一个或多个节,每个节可以有多个参数(键=值)。 创建配置文件: import configparser #配置文件 config = configparser.ConfigParser() """生成configparse 阅读全文
posted @ 2021-12-27 11:13 咖啡馆 阅读(153) 评论(0) 推荐(0) 编辑
摘要:示例一: """ 获取福田汽车新闻咨询标题 """ import requests from bs4 import BeautifulSoup res = requests.get("https://www.foton.com.cn/webback/news/newsList") text = re 阅读全文
posted @ 2021-12-20 15:29 咖啡馆 阅读(54) 评论(0) 推荐(0) 编辑
摘要:import threading import pymysql from dbutils.pooled_db import PooledDB MYSQL_DB_POOL = PooledDB( creator=pymysql, # 使用链接数据库的模块 maxconnections=5, # 连接池 阅读全文
posted @ 2021-12-17 11:26 咖啡馆 阅读(208) 评论(0) 推荐(0) 编辑
摘要:Mysql事务特性见:mysql-事务 python 对事务的操作: import pymysql ## 链接数据库 conn = pymysql.connect(user='root', password='123', host='127.0.0.1', port=3306, charset='u 阅读全文
posted @ 2021-12-17 10:04 咖啡馆 阅读(759) 评论(0) 推荐(0) 编辑
摘要:事务的四大特性: 原子性(Atomicity): 一个事务(transaction)中的所有操作,要么全部完成,要么全部不完成,不会结束在中间某个环节。事务在执行过程中发生错误,会被回滚(Rollback)到事务开始前的状态,就像这个事务从来没有执行过一样。 一致性(Consistency): 在事 阅读全文
posted @ 2021-12-17 09:46 咖啡馆 阅读(36) 评论(0) 推荐(0) 编辑
摘要:创建账号: create user 'yy'@'127.0.0.1' identified by '123'; 删除用户: drop user 'yy'@'127.0.0.1'; 修改用户: rename user 'yy'@'127.0.0.1' to 'zz'@'10.10.80.44'; 授权 阅读全文
posted @ 2021-12-16 14:22 咖啡馆 阅读(36) 评论(0) 推荐(0) 编辑
摘要:条件查询: -- 查询name = '测试' 或 email="test.com" 和id=1 select * from db where (name = '测试' or email="test.com") and id=1; -- 查找id在(1,2,3) select * from db wh 阅读全文
posted @ 2021-12-15 18:54 咖啡馆 阅读(48) 评论(0) 推荐(0) 编辑
摘要:创建数据库: CREATE DATABASE 数据库名; 删除数据库: drop database 数据库名; 创建数据表: CREATE TABLE table_name (列名 列的类型); ## 例子: create table test( id int not null primary ke 阅读全文
posted @ 2021-12-15 18:01 咖啡馆 阅读(26) 评论(0) 推荐(0) 编辑
摘要:环境:mysql(5.7.17)+boost(1_59_0) 关闭防火墙(firewalld): systemctl stop firewalld systemctl enable firewalld 关闭SeLinux: vim /etc/selinux/config SELINUX=disabl 阅读全文
posted @ 2021-12-15 17:16 咖啡馆 阅读(50) 评论(0) 推荐(0) 编辑
摘要:""" 需求: 读取text.csv文件中的内容,写入数据库中 """" 建表: mysql> create table message( -> id int not null primary key auto_increment, -- 将id设置为主键+自增+不为空 -> video_id in 阅读全文
posted @ 2021-12-15 16:40 咖啡馆 阅读(155) 评论(0) 推荐(0) 编辑
摘要:下载安装包: 下载地址:https://downloads.mysql.com/archives/community/ 下载后直接解压,将解压后的文件放置存放目录即可 本文以“C:\Program Files\mysql-5.7.31-winx64”为例: 创建配置文件: 新建文件 my.ini [ 阅读全文
posted @ 2021-12-14 19:03 咖啡馆 阅读(90) 评论(0) 推荐(0) 编辑
摘要:1.删除文件夹 import shutil shutil.rmtree('文件夹') 2.拷贝文件夹 import shutil shutil.copytree('message', 'new_message') 3.拷贝文件 import shutil shutil.copy('db.xlsx', 阅读全文
posted @ 2021-12-10 15:02 咖啡馆 阅读(52) 评论(0) 推荐(0) 编辑
摘要:1.当前目录执行命令: import subprocess res = subprocess.getoutput('ls') print(res) 2.指定目录执行命令: import subprocess res = subprocess.check_output('ls',shell=True, 阅读全文
posted @ 2021-12-10 14:43 咖啡馆 阅读(67) 评论(0) 推荐(0) 编辑
摘要:md5加密(不可逆) import hashlib pwd = '123' obj = hashlib.md5() obj.update(pwd.encode('utf-8')) res = obj.hexdigest() print(res) 避免撞库风险,加盐 # -*- coding: utf 阅读全文
posted @ 2021-12-10 14:01 咖啡馆 阅读(274) 评论(0) 推荐(0) 编辑
摘要:网页视频下载,让用户选择,并保存在本地 # -*- coding: utf-8 -*- import os import requests from bs4 import BeautifulSoup def get_mp4_url(video_id): """ 根据视频ID构造视频的下载地址(已破解 阅读全文
posted @ 2021-12-09 11:38 咖啡馆 阅读(126) 评论(0) 推荐(0) 编辑
摘要:C/S架构 """ 客户端: 运行程序,链接服务器并获取服务器发送的欢迎登录信息 输入用户名和密码,并将用户名和密码发送到服务端进行效验 登录失败重试 登录成功,进入系统,提示登录成功 服务端: 客户端链接上服务端,返回,欢迎登录信息 等待客户端发送用户明明和和密码进行效验(用户名和密码在文件中) 阅读全文
posted @ 2021-12-08 17:36 咖啡馆 阅读(67) 评论(0) 推荐(0) 编辑
摘要:try: ## 逻辑代码 except Exception as e: ## try中的代码如果有异常,则该代码块中的代码会执行 finally: ## try中的代码无论是否报错,finally中的代码都会执行,一般用于释放资源 """ 例如处理文件,打开、操作,关闭的动作是必要执行的 """ 阅读全文
posted @ 2021-12-07 17:54 咖啡馆 阅读(32) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示