摘要: docker commit :从容器创建一个新的镜像。 打包建立新的镜像以后,初始化的只有打包的容器和服务,镜像中其他应用的配置保留 语法 docker commit [OPTIONS] CONTAINER [REPOSITORY[:TAG]] OPTIONS说明: -a :提交的镜像作者; -c 阅读全文
posted @ 2022-04-20 09:45 背后的猫咪 阅读(207) 评论(0) 推荐(0)
摘要: 今天要记录一下自己懵逼的一天,原来自己是Ubuntu系统,还以为是centos,导致命令错了 There are no enabled repos.Run "yum repolist all" to see the repos you have.You can enable repos with y 阅读全文
posted @ 2022-03-29 10:02 背后的猫咪 阅读(207) 评论(0) 推荐(0)
摘要: # pip3 install python-docxfrom docx import Documentfrom docx.shared import Inches# 创建word文档对象document = Document()# 添加标题document.add_heading('Document 阅读全文
posted @ 2021-09-08 11:43 背后的猫咪 阅读(331) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2021-09-03 11:09 背后的猫咪 阅读(16) 评论(0) 推荐(0)
摘要: 在正则表达式中,如果直接给出字符,就是精确匹配。用\d可以匹配一个数字,\w可以匹配一个字母或数字,所以: '00\d'可以匹配'007',但无法匹配'00A'; '\d\d\d'可以匹配'010'; '\w\w\d'可以匹配'py3'; .可以匹配任意字符,所以: 'py.'可以匹配'pyc'、' 阅读全文
posted @ 2021-08-31 11:32 背后的猫咪 阅读(100) 评论(0) 推荐(0)
摘要: goods = [('蔬菜',{'1':['苹果',2],'2':['梨',2.5]}),('日用百货',{'1':['手纸',3],'2':['牙刷',4.5]})]flag = 0cars = {}ka = int(input('请充值:'))while True: if flag==1: pr 阅读全文
posted @ 2021-08-30 15:36 背后的猫咪 阅读(41) 评论(0) 推荐(0)
摘要: map()作为高阶函数,事实上它把运算规则抽象了,因此,我们不但可以计算简单的f(x)=x2,还可以计算任意复杂的函数,比如,把这个list所有数字转为字符串: >>> list(map(str, [1, 2, 3, 4, 5, 6, 7, 8, 9])) ['1', '2', '3', '4', 阅读全文
posted @ 2021-08-25 09:23 背后的猫咪 阅读(50) 评论(0) 推荐(0)
摘要: 可迭代对象(包括迭代器和生成器):能被FOR循环遍历得都是可迭代对象 迭代器:能被NEXT调用并不断返回值得函数直到出现stop错误类型为迭代器 生成器(特殊得迭代器):生成器包括在迭代器中,有两次方式生成,一个是列表生成式方括号改为圆括号,一个是定义函数返回值为yield 阅读全文
posted @ 2021-08-25 09:14 背后的猫咪 阅读(24) 评论(0) 推荐(0)
摘要: def mul(*x): if len(x)==0: raise TypeError('hello world') else: for ii in x: if not isinstance(ii,(int,float)): raise TypeError('hello world') n = 1 f 阅读全文
posted @ 2021-08-23 17:30 背后的猫咪 阅读(35) 评论(0) 推荐(0)
摘要: 字符串格式化方法一<div '=""># a = 'Hello, %s' %1111<div '=""># b = 'Hi, %s, you have $%s.' % ('Michael',1111)<div '=""># print(b)<div '=""> 方法二<div '=""># a = 阅读全文
posted @ 2021-08-18 09:19 背后的猫咪 阅读(72) 评论(0) 推荐(0)