会员
周边
众包
新闻
博问
闪存
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
十一的杂文录
博客园
首页
新随笔
联系
管理
订阅
随笔- 264 文章- 0 评论- 6 阅读-
19万
上一页
1
···
4
5
6
7
8
9
下一页
2021年2月23日
一个很好用的ORM库--peewee
摘要: 发现一个很好用的 ORM 库 -- peewee 以下为简单示例 from peewee import * db = SqliteDatabase('test.db') # 定义表结构 class Person(Model): sex_set = ((0, '女'), (1, '男')) name
阅读全文
posted @ 2021-02-23 16:39 十一的杂文录
阅读(94)
评论(0)
推荐(0)
2021年2月20日
3 种进度条 -- 记录
摘要: 第一种:普通进度条 # 普通进度条 import sys import time def test(): for i in range(1, 101): print('\r', end='') print('Download progress: {}%'.format(i), '▋' * (i//2
阅读全文
posted @ 2021-02-20 11:31 十一的杂文录
阅读(150)
评论(0)
推荐(0)
loguru 简单使用
摘要: 使用Python自带的 logging 来记录日志会比较麻烦,查了下 大家都在用 loguru,看了下文档,发现是挺好用的,记录下笔记 安装 pip install loguru 简单使用 from loguru import logger logger.debug('this is a debug
阅读全文
posted @ 2021-02-20 10:45 十一的杂文录
阅读(161)
评论(0)
推荐(0)
2021年2月19日
Python设置电脑桌面壁纸
摘要: 其实 Python 设置电脑桌面壁纸是很简单的,主要是调用 win32gui 这个库来实现的 代码如下: import win32api import win32con import win32gui def setWindowsImage(imgPath): # 打开注册表 k = win32ap
阅读全文
posted @ 2021-02-19 16:50 十一的杂文录
阅读(570)
评论(0)
推荐(0)
2021年2月2日
JS启动Windows上的exe
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document<
阅读全文
posted @ 2021-02-02 11:09 十一的杂文录
阅读(281)
评论(0)
推荐(0)
2021年1月30日
爬虫接口
摘要: 网易严选评论接口 # 2021-01-30https://you.163.com/xhr/comment/listByItemByTag.json?csrf_token=1989fe6fac4d23c29e4e97c51176869f&__timestamp=1611990388329&itemId
阅读全文
posted @ 2021-01-30 15:55 十一的杂文录
阅读(218)
评论(0)
推荐(0)
pathlib简单使用, 比os简单
摘要: from pathlib import Path p = Path(r'D:\project\pachong\test1\a.txt') # 基本用法 ''' # 判断 p.is_dir() # 判断是否是目录 p.is_file() # 判断是否是文件 p.exists() # 判断路径是否存在
阅读全文
posted @ 2021-01-30 00:17 十一的杂文录
阅读(101)
评论(0)
推荐(0)
2021年1月29日
使用GUI--tkinter 制作一个批量修改文件名的桌面软件
摘要: ''' title:批量修改文件名称 author:huyang createtime:2021-01-29 14:50:00 ''' from tkinter import * from tkinter import filedialog from tkinter import messagebo
阅读全文
posted @ 2021-01-29 23:44 十一的杂文录
阅读(160)
评论(0)
推荐(0)
2021年1月26日
Python-docx插入图片报错“NameError: name 'Inches' is not defined”
摘要: 在使用 Python-docx 库操作Word文档时,需要插入图片,在设置宽高时,报错“NameError: name 'Inches' is not defined” 原因是:没有 导入 Inches 模块 解决方法: from docx.shared import Inches
阅读全文
posted @ 2021-01-26 22:25 十一的杂文录
阅读(1257)
评论(0)
推荐(0)
2021年1月22日
七种常见的字符串格式化方法
摘要: 1、保留小数点后两位 >>> print("{:.2f}".format(3.1415)) 3.14 2、带符号保留小数点后两位 >>> print("{:+.2f}".format(-3.1415)) -3.14 3、不带小数点 >>> print('{:.0f}'.format(2.7)) 3
阅读全文
posted @ 2021-01-22 15:57 十一的杂文录
阅读(964)
评论(0)
推荐(0)
2021年1月18日
python操作ini文件
摘要: '''python 操作 ini 文件 ini文件的特点,多个节(section),每个节下可以存储多个 k-v 值 ''' from configparser import ConfigParser config = ConfigParser() # 写ini文件 def wIni(): conf
阅读全文
posted @ 2021-01-18 16:31 十一的杂文录
阅读(278)
评论(0)
推荐(0)
2021年1月15日
js获取select标签的 value 和 text
摘要: <select name="" id="test"> <option value="a1">yi</option> <option value="a2">er</option> <option value="a3">san</option> </select> <button onclick="aa
阅读全文
posted @ 2021-01-15 16:41 十一的杂文录
阅读(444)
评论(0)
推荐(0)
js复制文字到剪切板
摘要: 此方法仅适用于 IE demo <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
阅读全文
posted @ 2021-01-15 16:25 十一的杂文录
阅读(106)
评论(0)
推荐(0)
js推送网页到扩展屏上
摘要: 需求: 电脑上有两个屏幕,想在主屏上的网页中点击一个按钮,副屏就可以显示需要推送过去的网页 实现方法: 本方法使用的是js来实现的,亲测可行,支持火狐,但是不支持谷歌 demo: 主屏网页:1.html <!DOCTYPE html> <html lang="en"> <head> <meta ch
阅读全文
posted @ 2021-01-15 16:03 十一的杂文录
阅读(785)
评论(0)
推荐(0)
2021年1月7日
数据库自增ID用完了会怎么样?
摘要: 记一个数据库方面的面试题:数据库自增ID用完了会怎么样? MySQL中 int 类型是4个字节,如果是有符号,那就是 [ -2^31 , 2^31-1 ], 如果是无符号,那就是 [ -2^31 , 2^32-1 ],那就是 4294967295 如果该表是需要频繁插入数据,那么是可能达到这么多数据
阅读全文
posted @ 2021-01-07 00:19 十一的杂文录
阅读(135)
评论(0)
推荐(0)
2020年10月23日
selenium报错:Message: stale element reference: element is not attached to the page document
摘要: 在使用selenium时,报了一个错误 报错的原因: 所引用的元素已过时,不再依附于当前页面。通常情况下,这是因为页面进行了刷新或跳转 解决方法: 重新定位元素 代码示例: # 旧代码(报错) lists = self.root.find_elements_by_xpath('/html/body/
阅读全文
posted @ 2020-10-23 11:14 十一的杂文录
阅读(2242)
评论(0)
推荐(0)
2020年8月25日
windows创建bat文件进行截图
摘要: 1.创建 bat 文件 2.编辑文件内容 start snippingtool
阅读全文
posted @ 2020-08-25 17:41 十一的杂文录
阅读(3981)
评论(0)
推荐(0)
2020年7月16日
每日一题--Python打印金字塔
摘要: def day1(num): s = 'abcdefghijklmnopqrstuvwxyz' * (num // 26 + 1) for i in range(1, num + 1): print('{0:^{1}}'.format(s[:i] + s[:i -1][::-1], num * 2
阅读全文
posted @ 2020-07-16 11:03 十一的杂文录
阅读(319)
评论(0)
推荐(0)
Python操作临时文件---tempfile
摘要: # 使用标准库中 tempfile 下的 TemporaryFile,NamedTemporaryFile # TemporaryFile(mode='w+b', bufsize=1, suffix='', prefix='tmp', dir=None) # NamedTemporaryFilep(
阅读全文
posted @ 2020-07-16 10:15 十一的杂文录
阅读(352)
评论(0)
推荐(0)
2020年7月15日
OS常用功能--持续更新
摘要: import os # 拼接路径 print(os.path.join('a', 'b', 'c')) # 获取当前路径 print(os.getcwd()) # 在当前文件夹创建文件夹a # os.makedirs('a') # 将相对路径转为绝对路径 print(os.path.abspath(
阅读全文
posted @ 2020-07-15 19:22 十一的杂文录
阅读(153)
评论(0)
推荐(0)
Python删除文件、文件夹----os
摘要: 使用 os 删除文件 import os '''删除文件 语法: os.unlink(path) 示例: 删除 b 文件夹中的 12.txt ''' os.unlink('b/12.txt') 使用 os 删除文件夹 import os '''删除文件夹 语法: os.rmdir(path) 示例:
阅读全文
posted @ 2020-07-15 17:54 十一的杂文录
阅读(424)
评论(0)
推荐(0)
Python拷贝、移动、重命名、删除文件和文件夹----shutil
摘要: 拷贝 # 拷贝文件import shutil # 语法: shutil.copy(src, dst) '''示例 将 a 文件夹中的 a.txt 拷贝到 b 文件夹 ''' shutil.copy('a/a.txt', 'b') # 拷贝文件夹 import shutil # 语法: shutil.
阅读全文
posted @ 2020-07-15 17:47 十一的杂文录
阅读(1330)
评论(0)
推荐(0)
2020年7月5日
tkinter属性--转载Tynam Yang
摘要: 一、主要控件 1.Button 按钮。类似标签,但提供额外的功能,例如鼠标掠过、按下、释放以及键盘操作事件 2.Canvas 画布。提供绘图功能(直线、椭圆、多边形、矩形) 可以包含图形或位图 3.Checkbutton 选择按钮。一组方框,可以选择其中的任意个(类似HTML 中的checkbox)
阅读全文
posted @ 2020-07-05 22:22 十一的杂文录
阅读(206)
评论(0)
推荐(0)
2020年7月4日
pyqt5报错:qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" This ap
摘要: 环境: win10 Python 3.7.5 vs code 解决方法: 新建环境变量,然后重启 vs code 就可以了 QT_QPA_PLATFORM_PLUGIN_PATH C:\Users\Administrator\Desktop\新建文件夹 (2)\venv\Lib\site-packa
阅读全文
posted @ 2020-07-04 19:03 十一的杂文录
阅读(6025)
评论(0)
推荐(1)
2020年6月19日
cmd中怎么清屏--cls
摘要: 平时我们在 Linux 系统中清除屏幕 用的命令是: clear 现在在Windows上用的清屏命令是 : cls
阅读全文
posted @ 2020-06-19 00:23 十一的杂文录
阅读(1291)
评论(0)
推荐(0)
2020年6月12日
pycharm汉化
摘要: pycharm汉化最简单的方法 本方法的优点: 1.简单 2.jar包小 (1.1M) 3.下载方便 汉化包下载: 百度网盘: 链接:https://pan.baidu.com/s/158OAmVFwO9AqfZfhd2w-Hw 提取码:oggi 蓝奏云: https://wwa.lanzous.c
阅读全文
posted @ 2020-06-12 18:12 十一的杂文录
阅读(344)
评论(0)
推荐(0)
2020年6月10日
jemter做参数化的几种方法
摘要: 第一种:使用用户参数:添加--前置处理器--用户参数
阅读全文
posted @ 2020-06-10 14:53 十一的杂文录
阅读(163)
评论(0)
推荐(0)
jemter返回结果中文乱码
摘要: 如图,返回的结果,中文出现乱码 对于这个问题有两种解决方法 第一种:修改jemeter文件,需要重启jemter 在 bin 目录下,找到 jmeter.properties 这个文件,修改编码格式,修改完后需要重启 jemter # jemeter v5.3 在 1085 行 # 修改前 # Th
阅读全文
posted @ 2020-06-10 13:41 十一的杂文录
阅读(157)
评论(0)
推荐(0)
2020年6月2日
Python多线程
摘要: 多线程 Python3通过两个标准库提供对线程的支持:_thread / threading python中使用线程有两种方法:函数或者用类来包装线程对象 _thread:用函数来包装线程对象 threading:用类来包装线程对象 _thread 函数式:调用 _thread 模块中的 start
阅读全文
posted @ 2020-06-02 17:39 十一的杂文录
阅读(162)
评论(0)
推荐(0)
2020年5月29日
Python队列----queue
摘要: import queue # 官网文档:https://docs.python.org/3/library/queue.html a1 = queue.Queue() # 先进先出队列 a2 = queue.LifoQueue() # 先进后出队列 a3 = queue.PriorityQueue(
阅读全文
posted @ 2020-05-29 16:37 十一的杂文录
阅读(380)
评论(0)
推荐(0)
上一页
1
···
4
5
6
7
8
9
下一页
公告
昵称:
十一的杂文录
园龄:
5年1个月
粉丝:
12
关注:
4
<
2025年6月
>
日
一
二
三
四
五
六
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
点击右上角即可分享