日常记录(2020年9月)

tech2023-12-01  27

9月3日

HTTP请求方式中8种请求方法

https://www.runoob.com/http/http-methods.html

https://www.runoob.com/http/http-messages.html

前端后端的区别...

cv2.imread读取图片时,如果路径有中文,会报错;Windows会报错,linux不会报错

9月4日 

glob是python自己带的一个文件操作相关模块

功能: (1) 用它可以查找符合自己目的的文件,支持通配符操作;

            (2) 用它批量抓取某种格式、或者以某个字符打头的文件名;

            (3) 解决os.listdir()读取文件乱序问题。

例子:

         1. 匹配某指定路径下后缀为.exe的文件(绝对路径)

                    file = glob(path+ '*.EXE')

          2. 匹配某指定路径下以res开头的txt文件

                  filenames = glob.glob(path+"res*.txt")

          3. 读取文件并排序

                   filenames = sorted(glob.glob('*.txt')) (按名称排序)

          4. glob.iglob逐个获取匹配的文件路径名

注意: 三种通配符: '*' 匹配0个或多个字符; '?' 仅匹配一个字符;  ‘[]’ 匹配指定范围内的字符,如[0-9]匹配数字

           sorted函数参考:https://www.runoob.com/python/python-func-sorted.html

           glob模块参考: 博客1 、博客2、博客3

 

9月7日 

配置paddle环境并执行代码

python3.7 -m pip install --upgrade pip

python3.7 -m pip install paddlepaddle-gpu==1.8.4.post107 -i https://mirror.baidu.com/pypi/simple

python3.7 -m pip install paddlehub -i https://mirror.baidu.com/pypi/simple

CUDA_VISIBLE_DEVICES=2 python3.7 main.py

 

numpy各种生成随机数的方法

Python生成不重复的随机数

python排序函数sort 、sorted 、argsort

 

9月10日

标识符的命名规范:

1. 小驼峰命名法:第一个单词的首字母小写,以后每个单词的首字母都大写  userNameAndPassword

2. 大驼峰命名法:每个单词的首字母都大写,PersonModel

3. 使用下划线连接: user_name_and_password

在python里的变量、函数和模块名使用下划线连接; python里的类名使用大驼峰命名法

 

字符串续行:

path = "abcdlkfsdfmsfl \ 

             aaaaaaaaaaa"

VScode插件官网:

https://marketplace.visualstudio.com/search?target=VSCode&category=Themes&sortBy=Installs

9月11日

linux中sh脚本文件的语法及使用

https://www.jb51.net/article/185260.htm

https://www.runoob.com/linux/linux-shell.html

 

ffmpeg:可以用来记录、转换数字音频、视频

官网:http://ffmpeg.org/

安装包:http://ffmpeg.org/releases/

centos7安装教程:https://blog.csdn.net/shgh_2004/article/details/107213675

9月12号

FFmpeg图片合成视频

 

9月13号

Windows下执行shell脚本

https://www.cnblogs.com/woods1815/p/11026658.html

测试文件:mkdir.sh

#!/bin/sh touch a.txt sleep 10 echo "testtesttesttest">>a.text

测试文件:test.sh

#!/bin/bash echo "hello world"

执行:

 

9月14号

x264参数设置详解:

https://x265.readthedocs.io/en/default/index.html

https://blog.csdn.net/yue_huang/article/details/79309696

https://wenku.baidu.com/view/f4e48c087fd5360cba1adbba.html?fr=search-1_income2

9月17号

ffmpeg命令详解:

https://www.cnblogs.com/AllenChou/p/7048528.html

https://blog.csdn.net/hemingwang0902/article/details/4382205

9月18日

ffmpeg常用功能:

https://blog.csdn.net/kingvon_liwei/article/details/79271361

https://trac.ffmpeg.org/wiki/Slideshow

 

9月21日

numpy数组拼接

https://blog.csdn.net/xiaodongxiexie/article/details/71774466

 

9月23日

import numpy as np

import cv2 as cv

from PIL import Image

img_path = "1.png"

img1 = Image.open(img_path)

img2 = cv.imread(img_path , cv.IMREAD_UNCHANGED)

print(img1.size, img2.shape)

pillow读入数据的格式是(宽,高, 通道)

cv读入数据的格式是(高,宽,通道)

 

9月28

终端输入: export PATH=~/anaconda3/bin:$PATH

终端输入: source activate

最新回复(0)