随笔分类 -  基础知识

常用基础知识
摘要:1 #获取文件夹内的图片 2 import os 3 def get_imlist(path): 4 return [os.path.join(path,f) for f in os.listdir(path) if f.endswith('.jpg')] 5 6 img_path = get_im 阅读全文
posted @ 2020-08-28 15:31 白月如初12138 阅读(7446) 评论(0) 推荐(0)
摘要:让python pip使用国内镜像#国内源:#清华:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:https://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.ustc.edu.cn 阅读全文
posted @ 2020-08-28 15:12 白月如初12138 阅读(1567) 评论(0) 推荐(0)
摘要:1 # -*- coding: utf-8 -*- 2 # @Time : 2020/8/18 16:56 3 # @Author : Chunfang 4 # @Email : 3470959534@qq.com 5 # @File : Weibo_content_socre.py 6 # @So 阅读全文
posted @ 2020-08-18 17:42 白月如初12138 阅读(109) 评论(0) 推荐(0)
摘要:一、配置环境1、file>>New project 创建文件名,配置python.exe执行路径2、setting.py配置①建立static文件夹,最后一行添加STATICFILES_DIRS=(os.path.join(BASE_DIR,'static'),)②注释MIDDLEWARE>>csr 阅读全文
posted @ 2020-08-12 17:22 白月如初12138 阅读(486) 评论(0) 推荐(0)
摘要:1 import os,glob 2 def photo_compression(original_imgage,tmp_image_path): 3 '''图片备份、压缩;param original_imgage:原始图片路径;param tmp_imgage_path:临时图片路径,备份路径; 阅读全文
posted @ 2020-07-04 11:24 白月如初12138 阅读(2119) 评论(0) 推荐(0)
摘要:1 a=[1,3,[5,9],[1,3],[2,4]] 2 b =[(1, [3, 9,1]), (2, [4, 8,4]), (3, [1, 2,5])] 3 b.sort(key=lambda x:x[1][1])#,reverse=True 二维列表排序,倒序 4 print(b) 5 b.s 阅读全文
posted @ 2020-06-05 15:17 白月如初12138 阅读(509) 评论(0) 推荐(0)