自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(33)
  • 资源 (6)
  • 收藏
  • 关注

原创 日常错误集

ABCDEERRORS:myApp.Students.scontend: (fields.E120) CharFields must define a ‘max_length’ attribute.CharFields类型必须添加max_length属性Exception: HTTP 599: SSL certificate problem: unable to get local issuer cer在self.crawl()最后加上validate_cert=False参数

2021-07-23 09:02:12 1201

原创 Ubuntu下配置22端口,实现远程连接

服务的sudu apt_get install openssh-server openssh-clientsudo /etc/init.d/ssh restart查看ipifconfig客户端使用xshell(这个地址下载的好用)用户名和密码是你远程的登录名和密码

2021-05-21 11:22:20 983

原创 Centos下执行python脚本

编写run.sh文件#!/bin/bashexport PATH=$PATH:/user/binsource /root/.virtualenvs/pscrapy/bin/activate pscrapynohup python test.py > test.log 2>&1 &执行run.sh文件./runsh

2021-05-18 08:48:57 458

原创 Pandas

读写数据读取格式pd.read_xxx('https://xxx.xxx')pd.read_xxx('xxx.xlsx')类型pd.read_excel()pd.read_csv()写入df.to_excel('xxx.xlsx')df.to_csv('team-done.csv')数据概况df.info() # 查看数据类型、索引情况、行列数、字段类型、内存等df.describe() # 计算数字字段的总数、平均数、标准差、最大

2021-05-08 17:51:42 117

原创 安装Linux(单系统)

下载https://ubuntu.com/download/desktophttps://cn.ultraiso.net/xiazai.html制作启动盘打开UltralSO软件左上角打开文件 —> 找到Ubuntu IOS文件并选中点击工具栏的启动 —> 写入硬盘映像 —> 写入方式 —> 选择USB-HDD+ —> 便捷启动—> 写入新的驱动器引导扇区 —> Syslinux —> 后面都选择确定安装开机按F12(根据..

2021-05-08 09:56:54 421

原创 Ubuntu安装搜狗输入法

下载http://pinyin.sogou.com/linux安装sudo dpkg -i sogoupinyin_2.4.0.3469_amd64.deb打开系统设置 —> 语言支持 —> 安装弹出的提示框 —> 等待安装完 —> 把IBus改为fcitx —> 关机重启 —>右键点击桌面右上角的键盘 —> 选择ConfigureFcitx —> 点击左下角的+号,添加搜狗输入法 —> 然后关闭 —> 再重启一下就ok..

2021-05-08 08:58:34 101

原创 Ubuntu安装谷歌浏览器

下载https://www.google.cn/chrome/选择64位 .deb安装sudo dpkg -i google-chrome-stable_current_amd64.deb打开浏览器google-chrome

2021-05-08 08:58:01 319

原创 Ubuntu安装PyCharm

下载https://www.jetbrains.com/pycharm/download/#section=windows解压右键安装包,点击"Extract Here"安装cd pycharm-2021.1.1/binsh ./pycharm.sh

2021-05-08 08:57:26 81

原创 Centos下定时执行python脚本(在虚拟环境下)

编写shell脚本vim run.sh#!/bin/bashexport PATH=$PATH:/usr/binecho -n '开始'source /root/.virtualenvs/pscrapy/bin/activate pscrapy (路径是当前python的路径)cd /work/policy && scrapy crawl gov_placeecho -n '结束'编写定时任务crontab -e10 1 * * * /wo..

2021-05-06 17:24:58 460

原创 Centos配值mysql远程登陆

登录MySQLmysql -u root -p 密码进行授权允许root用户,在 任何ip 登录,并具有所有库的 任何操作 权限GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;允许root用户,在 指定ip 登录,并具有所有库的 任何操作 权限GRANT ALL PRIVILEGES ON *.* TO root@"指定ip" IDENTIFIED BY "密码" WITH.

2021-05-06 15:50:50 59

原创 Centos安装MySQL

查看是否自带MySQLrpm -qa | grep mysql卸载(可选)rpm -e --nodeps mysql安装wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpmrpm -ivh mysql-community-release-el7-5.noarch.rpmyum updateyum install mysql-server设置权限chown mysql:mysql..

2021-05-06 02:08:27 146

原创 Centos安装Python虚拟环境

安装pip install virtualenv virtualenvwrapper查看安装位置find / -name virtualenvfind / -name virtualenvwrapper.sh建立软连接ln -s /usr/local/python3/bin/virtualenv /usr/bin/virtualenv修改环境变量vim /root/.bashrcexport WORKON_HOME=/root/.virtualenvs..

2021-04-30 16:10:05 124 1

原创 Centos安装Python

安装依赖yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel下载源码包wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz解压tar -zxvf Python-3.6.5.tgz编译、安装cd Python-3.6.5./configure --prefix=/usr/l..

2021-04-30 11:29:56 160

原创 Python安装、导出环境依赖

导出:pip freeze > requirements.txt安装:pip install -r requirements.txt

2021-04-28 09:25:47 102

原创 Python-Json

dumpjson.dump() ->用于将dict类型转成str,并写入json文件loadjson.load() -> 用于从json文件中读取数据dumpsjson.dumps() -> 用于将dict转成strloadsjson.loads() -> 用于将str类型转成dict

2021-01-25 13:34:03 87 1

原创 Python-docx

读取wordimport docxfile = docx.Document('文件')for para in file.paragraphs: print(para.text)

2020-12-24 13:05:34 129

原创 Python-win32com

用于doc转docxfrom win32com import clientdef doc_to_docx(file): # 打开word应用程序 word = client.Dispatch("Word.Application") # 打开word文件 doc = word.Documents.Open(file) # 另存为后缀为".docx"的文件,其中参数12指docx文件 doc.SaveAs("{}x".format(file), 12)

2020-12-24 12:18:28 124

原创 GIT使用

GIT使用1.安装Git官网直接下,默认安装https://git-scm.com/downloads2.配置用户和邮箱git config – global user.name “xxx”git config – global user.email “xx@xx.com”3.创建目录mkdir xxxcd xxxpwd -> 查看创建目录的路径4.把目录变成Git仓库git init5.把文件添加到暂存区git add xxx6

2020-12-20 23:13:53 243

原创 Python-yaml

yaml.load(stream, Loader=yaml.FullLoader)作用:直接将字典转为json格式

2020-12-16 15:46:00 238

原创 Python-正则表达式

re.match(pattern, string, flags)作用:只匹配字符串的开始部分pattern:正则表达式,匹配成功返回Match,否则返回Nonestring:字符串flags:匹配方式,如:区分大小写等re.search(pattern, string, flags)作用:匹配整个字符串参数与re.match一样re.sub(pattern, repl, string, count)作用:替换匹配到的字符串repl:替换的字符count:替换个数..

2020-12-16 15:21:09 48

原创 Django-限流代码

seting配置REST_FRAMEWORK = { .... 'DEFAULT_THROTTLE_CLASSES': ( 'rest_framework.throttling.AnonRateThrottle', 'rest_framework.throttling.UserRateThrottle' ), 'DEFAULT_THROTTLE_RATES': { 'anon': '3/min', 'user': '

2020-05-18 15:30:59 223

原创 Django-分页代码

setting配置REST_FRAMEWORK = { # 配置默认页面大小 'PAGE_SIZE': 5, # 配置默认的分页类 'DEFAULT_PAGINATION_CLASS': 'api.helpers.CustomPagination',

2020-05-18 15:24:19 80

原创 Django-缓存代码

django.core.cache里的缓存方法@api_view(('GET',))def get_district(request, distid): district = caches['default'].get(f'district:{distid}') if district is None: district = District.objects.filter(distid=distid).defer('parent').first() cac

2020-05-18 14:54:37 196

原创 Django-debug_toolbar配置代码

setting中的代码INSTALLED_APPS = [ ... 'debug_toolbar', ...]MIDDLEWARE = [ 'debug_toolbar.middleware.DebugToolbarMiddleware', ...]DEBUG_TOOLBAR_CONFIG = { # 引入jquery库 'JQUERY_URL': 'https://cdn.bootcss.com/jquery/3.4.1/jquery.m

2020-05-17 13:48:39 258

原创 Python-哈希摘要代码

字段哈希代码from hashlib import md5hasher = md5('123456'.encode())hasher.hexdigest()文件哈希代码from hashlib import md5with open('xxxx.exe', 'rb') as file: //生成迭代器 file_iter = iter(lambda: file.read(512), b'') //生成哈希 for data in file_iter: hasher.update(d

2020-05-17 13:48:20 124

原创 Django-表变模型

表变模型:python manage.py inspectdb > xxx/models.py

2020-05-08 23:24:07 82

原创 django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3

可能出现Django2.2和pymysql版本不兼容问题,如下: raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.解决方案将instal

2020-05-08 23:11:12 82

原创 AttributeError: 'str' object has no attribute 'decode'

可能出现pymysql出现不兼容问题,如下: File "C:\Users\Administrator\zufang\venv\lib\site-packages\django\db\backends\mysql\operations.py", line 146, in last_executed_query query = query.decode(errors='replace')AttributeError: 'str' object has no attribute 'decode'

2020-05-08 23:00:20 232

原创 Python-第三方库的国内源

豆瓣 https://pypi.doubanio.com/simple

2020-05-08 16:38:30 1233

原创 配置密钥对

1.ssh-keygen -t rsa -b 2048 -C ‘邮箱’(默认回车)2.cd .ssh3. id_rsa(私钥) id_rsa.pub(公钥)4.cat id_rsa.pub

2020-05-08 16:15:35 201

原创 CentOS安装docker

一、安装Docker1、yum update2、yum install -y docker3、systemctl start docker二、在Docker中安装镜像docker pull 镜像名三、查看在Docker中已经下载的镜像docker images...

2020-04-13 17:47:12 129

原创 Git版本克隆方法

一、git clone ssh地址二、cd 克隆的项目文件夹三、git log(查看历史commit)四、git checkout commit

2020-04-13 11:46:29 352

原创 Python-虚拟环境的搭建和连接云服务器(完整流程)

1.更新源sudo apt-get update2.查看是否安装pippip3.安装pipsudo apt install python3-pip4.安装虚拟环境pip install virtualenvpip install virtualenvwrapper5.创建文件夹mkdir .virtualenvs6.查看virtualenvwrapper.sh位置find ...

2020-03-18 01:11:47 838

苹果手机数据恢复工具.zip

苹果手机数据恢复工具.zip

2021-05-31

艾奇文件数据恢复软件全能版.zip

计算机

2021-05-31

Xpath个人免费版.rar

Xpath个人免费版.rar

2021-05-31

EdrawMax_v10个人版.7z

EdrawMax_v10个人版.7z

2021-05-31

Navicat Premium 15.zip

Navicat Premium 15.zip

2021-05-31

XShell官方免费版

XShell官方免费版

2021-05-08

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除