Python的写操作


Python的写操作案例:# 打开文件f = open('./python.txt', 'w', encoding="UTF-8")# 文件写入f.write('hello world')# 本质上并没有把内容写到python.tx

Python 文件的读取和操作


Python 文件的读取和操作打开文件:在python种,使用open函数,可以打开一个已经存在的文件,或者创建一个新文件,语法如下VariableName = open(name,mode,encoding)name:是要打开的目标文件名的字符串mode:设置打开文件的模式(访问模式):只读,写入

python组件


1. 生成6位数字随机验证码import randomimport stringdef num_code(length=6): """ 生成长度为length的数字随机验证码 :param length: 验证码长度 :return: 验证码

Python 匿名函数


Python 匿名函数Python作为参数传递案例:函数compute,作为参数,传入了test_func函数中使用def test_func(compute): result = compute(1, 2) print(result)def compute(x, y): retu

Python数据结构


Python数据结构list创建两个列表Listname = ["meowrain","mike","John"]matrix = [[0,1],[2,3]]访问列表中的值name = ["a","b"

Python 函数传入多个参数


Python 函数传入多个参数直接在传参处填写 *形参就行了如下,我们写一个计算乘法的函数def multiply(*numbers): total = 1 for i in numbers: total *= i return totalprint(multiply

Python内置函数的使用


Python内置函数的使用# Python内置函数print(round(2.5)) # 取整数print(abs(-2.5)) # 取绝对值name = ' meowrain'print(name.upper()) # 全部大写print(name.lower()) # 全

Python格式化字符串常量f-string


Python格式化字符串常量f-string直接举例子吧:我们想打印出meowrain is 18 years old可以这么写name = 'meowrain 'age = 18print(name + 'is ' + str(age) + ' years

Python转义字符\


Python转义字符如果像下面这样写的话,会直接被IDE红线报错course = "python "programming""print(course)那么我想打印出python "programming"这样的字符串怎么办呢?这就要用到转

Git代理

笔记  Git 

Git配置clash http代理Windows命令git config --global http.proxy protocol://127.0.0.1:7890文件配置Git的全局配置文件位于C:\Users\username\.gitconfig我这边使用的是clash作为代理软件,它的htt