04 2020 档案

摘要:脚本比较粗糙,可根据这个思想去改写自己的脚本 这里使用Python脚本来实现,熟悉subprocess.Popen, os.popen docker save 镜像名(不需要加tag) -o tarname.tar import re import os from subprocess import 阅读全文
posted @ 2020-04-27 17:27 坚强的小蚂蚁 阅读(2538) 评论(0) 推荐(0) 编辑
摘要:一个类实例也可以变成一个可调用对象,只需要实现一个特殊方法__call__() class People: def __init__(self, name, age): self.name = name self.age = age def __str__(self): return "his na 阅读全文
posted @ 2020-04-15 14:07 坚强的小蚂蚁 阅读(127) 评论(0) 推荐(0) 编辑
摘要:局部变量在函数执行完成后就被销毁了。那么如果在line函数中使用了line_conf的变量,当line_conf函数执行完成后,在全局环境中的line函数还能使用line_conf中的变量吗? def line_conf(): b = 15 def line(x): return 2*x + b r 阅读全文
posted @ 2020-04-14 14:21 坚强的小蚂蚁 阅读(126) 评论(0) 推荐(0) 编辑
摘要:model如下 class Publisher(models.Model): name = models.CharField(max_length=30) address = models.CharField(max_length=50) website = models.URLField() cl 阅读全文
posted @ 2020-04-01 14:20 坚强的小蚂蚁 阅读(306) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示