摘要:
原文https://www.bilibili.com/video/BV1tt411e7zF?p=6 阅读全文
摘要:
exec code in self.locals 错误主要是因为在 python3 环境下 , 进行 debug 调试,源码没有进行更新导致. 需要将 exec code in self.locals 修改为 exec(code in self.locals) 注: 文件名不要写为 code.py 阅读全文
摘要:
读取时,不读取第一列 data = pd.read_csv('data.csv',index_col=0) df_length = 0 for i in df['列名'].values: if i is not np.nan: df_length += 1 print(df_length) 阅读全文
摘要:
解决办法 添加参数 ensure_ascii=False json.dumps(字典,ensure_ascii=False) 阅读全文
摘要:
INSERT INTO 数据表名称(字段1,字段2) SELECT 插入的值1,值2 FROM DUAL WHERE NOT EXISTS(SELECT * FROM 数据表名称 WHERE 字段1= 值1 AND 字段2= 值2) DUAL 不需要进行修改 INSERT INTO table(fi 阅读全文
摘要:
定义 import threading class hy_Timer(threading.Timer): def __init__(self, interval, function, args=[], kwargs={}): self._original_function = function su 阅读全文
摘要:
将 self.core.proj_path 替换为 self.aim_path 即可 阅读全文
摘要:
阅读全文
摘要:
from datetime import datetime print(datetime.strptime(str(datetime.now()).split('.')[0],"%Y-%m-%d %H:%M:%S")) 阅读全文
摘要:
在函数前加上 @profile 在终端输入 python -m memory_profiler 文件名.py python -m memory_profiler 阅读全文
摘要:
使用 recordclass.mutabletuple 方法进行创建元组 使用 recordclass.make_dataclass 创建字典 注:还需要进行添加值信息 import recordclass # 占用更少的内存 # 创建一个元组 Point_tuple = recordclass.m 阅读全文
摘要:
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash 阅读全文
摘要:
导入 turtle 语句 import turtle 设置画布 turtle.screensize(canvwidth=None,canvheight=None,bg=None) 默认大小为 400 x 300 turtle.screensize() 设置画布为宽 500,高 300 的 灰色为画布 阅读全文
摘要:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 包名 pip install -i https://pypi.mirrors.ustc.edu.cn/simple 包名 pip install 第三方库名称 -i http://pypi 阅读全文
摘要:
def ns(): import pyperclip while True: s = input() result = '' for i in s[:-1]: result += i + '\n' result += s[-1] pyperclip.copy(result) 阅读全文
摘要:
安装 pip install -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com psutil 导包 import psutil 获取所有的进程 id psutil.pids() 获取指定进程 p = psutil.Pro 阅读全文
摘要:
导包 import os os.startfile("文件夹路径/文件路径") 打开指定文件夹 os.startfile("F:\XMind") 打开指定文件 os.startfile("F:\XMind\XMind.exe") 阅读全文
摘要:
安装命令 pip install -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com pyautogui 获取鼠标位置 pyautogui.position() 实现鼠标双击左键 pyautogui.click(click 阅读全文
摘要:
简书:pipenv快速入门 阅读全文
摘要:
CMD命令:开始->运行->键入cmd或command(在命令行里可以看到系统版本、文件系统版本) chcp 修改默认字符集 chcp 936默认中文 chcp 65001 1. appwiz.cpl:程序和功能 2. calc:启动计算器 5. chkdsk.exe:Chkdsk磁盘检查(管理员身 阅读全文
摘要:
阅读全文
摘要:
阅读全文
摘要:
background-image: url(图片的相对路径); 如: background-image: url(../static/images/背景.jpg); <style> body{ background-image: url(../static/images/背景.jpg); backg 阅读全文
摘要:
cd 命令,改变当前目录 进入到指定目录中 cd 目录名 跳转到上一层目录中 cd .. 返回到根目录 cd \ dir 显示目录下的文件和子目录 md 新建目录 根据绝对路径来创建目录 md 绝对路径\目录名 显示文件内容 type 文件名.后缀名 copy 复制一个或一组文件到指定磁盘或者目录中 阅读全文
摘要:
1. python基础知识点 2. 字符串 3. 排序 4. 数据结构 5. 正则表达式 6. 线程 7. math 库 random 库 wordcloud 库 8. numpy基础 9. pandas基础 10. matplotlib简单图 11. mysql语句 12. 使用 pymysql 阅读全文
摘要:
from bs4 import BeautifulSoup,element # 导入 BeautifulSoup import lxml import requests html_doc = """ <html><head><title>The Dormouse's story</title></h 阅读全文
摘要:
import browserhistory as bh bh.write_browserhistory_csv() 2021-03-06 阅读全文
摘要:
打开 VMware Workstation, 点击创建新的虚拟机 选择 自定义(高级) 可以直接点击下一步(此处我的 VMware 版本是 16.0.0 的) 点击 稍后安装操作系统 上方选择 Linux, 下方选择 CentOS 6 64位 选择虚拟机要安装的位置, 最好大于 20 G 处理器和内 阅读全文
摘要:
我错误的原因 一开始误将数据表通过 navicat 删除了,导致了这个错误的出现 解决方法: 在终端输入 python manage.py migrate --fake 然后进行迁移即可(注:数据需要重新录入) python manage.py migrate 2021-02-05 阅读全文
摘要:
前端框架 LayUI 官网 https://www.layui.com/doc/ 栅格布局 <div class="layui-container"> <h2>常规布局(以中型屏幕桌面为例):</h2> <div class="layui-row"> <div class="layui-col-md 阅读全文
摘要:
字体 import matplotlib.pyplot as pltplt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签 plt.rcParams['axes.unicode_minus']=False #用来正常显示负号 折线图 plot_p 阅读全文
摘要:
创建 Scrapy 项目 scrapy startproject 项目名 scrapy genspider name 起始网址 运行 Scrapy框架 scrapy crawl 名称 修改 chouti.py 下的 parse 方法,打印 response 没有日志写法为 scrapy crawl 阅读全文
摘要:
导包 import prettytable as pt 创建 PrettyTable 对象 tb = pt.PrettyTable() 添加列名 tb.field_names tb.field_names = ['列名1', '列名2','...','列名n'] 添加值 tb.add_row tb. 阅读全文
摘要:
https://www.kesci.com/mw/project/5fed77a7840381003bfe8167 阅读全文
摘要:
列表 list append clear copy count extend index insert pop remove reverse sort 元组 tuple count index 字典 dict clear copy fromkeys get items keys pop popite 阅读全文
摘要:
请求头 headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36 Edg 阅读全文
摘要:
数据库 test ,boys 表当前数据 数据库 boys 表。在新建数据库 test 之后可以导入进去,运行SQL文件 /* Navicat Premium Data Transfer Source Server : localhost_3306 Source Server Type : MySQ 阅读全文
摘要:
import uuid name = uuid.uuid4() print(name) 类型为 <class 'uuid.UUID'> 2021-01-07 阅读全文