![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
只做为笔者笔记和读者参考,写的不好。
smile学无止境1
感谢每一段经历,不好走也不难走。
展开
-
Django POST请求-获取参数
Django 如何获取前端发送的数据原创 2023-02-06 10:06:48 · 2147 阅读 · 0 评论 -
django中间件小知识
django中间件小白必须知道的知识点。原创 2022-11-09 12:25:20 · 381 阅读 · 0 评论 -
使用python安装nginx
#!/usr/bin/python3# -*- conding: UTF-8 -*-import subprocessimport os import shutilimport reimport tarfiledef execute_cmd(cmd):p=subprocess.Popen(cmd,shell=True,stdin=subprocess.PIPE,stderr=subprocess.PIPE,stdout=subprocess.PIPE) stdout,stderr=p.c原创 2022-01-14 16:31:25 · 2165 阅读 · 0 评论 -
python 备份脚本
适用环境:在服务器中经常会备份我们服务器的日志,以备不时之需。下面脚本可以基本上完全满足我们的需求。find_bak_files用于搜索我们的日志。下面脚本以httpd为例子#!/usr/bin/python3# -*- conding: UTF-8 -*-import tarfileimport timeimport fnmatchimport osimport sysdef find_bak_files(root='/var/log/httpd'): formats=['access原创 2022-01-14 10:55:01 · 200 阅读 · 0 评论 -
linux 使用python脚本 找出指定目录下重复文件,并作出处理。
#!/usr/bin/python3#-*- coding: UTF-8 -*-import hashlibimport sysimport osimport fnmatchCHUNK_SIZE = 8192def find_specific_files(root): file_path=[] formats=['*.txt','*.bak','*.log','*.py','*.sh'] for root,dirname,filenames in os.walk(root):原创 2022-01-13 15:00:18 · 330 阅读 · 0 评论