12 2018 档案
摘要:def judge_password(password): if len(password) >= 8: pattern = re.compile('[A-Z]+') match = pattern.findall(password) if match: pattern = re.compile('[a-z]+') ...
阅读全文
摘要:yum -y install mariadb mariadb-server systemctl start mariadb #设置开机启动 systemctl enable mariadb # 简单相关配置 mysql_secure_installation # 详情请参考https://www.cnblogs.com/zhanzhan/p/7729981.html
阅读全文
摘要:vim /etc/resolv.conf nameserver 119.29.29.29 nameserver 182.254.116.116 nameserver 8.8.8.8
阅读全文
摘要:msg = '\033[41;1m字符串内容\033[0m' print(msg) # \033[41;1m起始位置 改变41数值就是改变其他颜色,、033[0m 结束位置
阅读全文
摘要:test = 'alEx' print(test.capitalize()) # 首字母大写 其他都变小写 print(test.casefold()) # 变小写 更牛逼 print(test.lower()) # 全部变小写 print(test.center(20, '*')) # 设置宽度,一共20个位置,将test放中间,其他用*拼接 print(test.count...
阅读全文
摘要:import sys import time # print(sys.argv) for i in range(100): # 进度条 sys.stdout.write('#') time.sleep(0.1) sys.stdout.flush()
阅读全文
摘要:适配于centos7 1.安装vncserver 2、安装novnc 3、以上操作只能连接本机,高级用法 4、速度慢,安装numpy 5、查看是否安装成功
阅读全文
摘要:import sys, os print(__file__) # 绝对路径,实际是文件名 /Users/majianyu/Desktop/test/bin/bin.py print(os.path.abspath(__file__)) # 绝对路径 print(os.path.dirname(__file__)) # 文件夹路径 /Users/majianyu/Desktop/tes...
阅读全文
摘要:keepcache=0 更改为1下载RPM包 不会自动删除 vi /etc/yum.conf 只下载安装包,不安装指令
阅读全文
摘要:def fetch(data): print(' 查询功能') print('用户数据是',data) def add(): pass def change(): pass def delete(): pass if __name__ == '__main__': msg = ''' 1: 查询 2. 添加 ...
阅读全文
摘要:python中自带logger模块,实现方法有两种,一般使用第二种,更灵活 方法一: 方法二: logger的踩坑
阅读全文
摘要:from functools import reduce num_1 = [1, 2, 3, 4, 5] #加法 def reduce_test(array): res = 0 for num in num_1: res += num return res #乘法 def reduce_test(func, array, init=None): ...
阅读全文
摘要:movie_people = ['sb_alex', 'sb_wupeiqi', 'hello'] def filter_test(array): ret = [] for p in array: if not p.startswith('sb'): ret.append(p) return ret res = filter_t...
阅读全文
摘要:map函数形参为一个函数和一个迭代对象 给定一个列表,实现加1
阅读全文
浙公网安备 33010602011771号