随笔分类 -  笔记

摘要:windows ping 带时间戳 </h1> <div class="clear"></div> <div class="postBody"> <div id="cnblogs_post_description" style="display: none"> windows ping 时间戳 </ 阅读全文
posted @ 2021-04-29 08:25 去遇见最好的自己 阅读(667) 评论(0) 推荐(0) 编辑
摘要:修改接口trunk为access模式有2种方式: 第一种: 直接清除此接口的配置,重新设置 clear con int g0/0/0 第二种: [Huawei]int g0/0/3 [Huawei-GigabitEthernet0/0/3]undo port trunk allow-pass vla 阅读全文
posted @ 2021-04-27 14:19 去遇见最好的自己 阅读(2716) 评论(0) 推荐(0) 编辑
摘要:![](https://img2020.cnblogs.com/blog/1087691/202104/1087691-20210427131251174-326756671.png) 阅读全文
posted @ 2021-04-27 13:13 去遇见最好的自己 阅读(567) 评论(0) 推荐(0) 编辑
摘要:目录结构 配置celery 创建任务 启动woker:celery -A celery_task worker -l info -P eventlet 自动添加任务:celery -A celery_task beat -l info 阅读全文
posted @ 2020-10-29 11:51 去遇见最好的自己 阅读(1107) 评论(0) 推荐(0) 编辑
摘要:from django.db.models.fields import FieldDoesNotExist 错误代码如下: Traceback (most recent call last): File "../../manage.py", line 15, in execute_from_comm 阅读全文
posted @ 2020-10-23 17:20 去遇见最好的自己 阅读(2028) 评论(0) 推荐(0) 编辑
摘要:# 封装 # 对外部隐藏具体的实现细节, 只提供简单的调用接口, 如USB接口 # 在类中, 用双下划线, 封装属性或方法, 外部不能调用, 不能继承 # 例: def __test(self): # 私有方法 pass __name = 'lee' # 私有属性 # 继承 # 将一些共同代码抽取成 阅读全文
posted @ 2019-12-15 13:58 去遇见最好的自己 阅读(120) 评论(0) 推荐(0) 编辑
摘要:global 定义一个或多个全局变量 globals() 存储所有全局变量 locals() 存储当前局部区域内,所有局部变量及方法 nonlocal 定义一个在闭包函数内,内部函数引用外部函数的属性 def outer(): n = 1 def inner(): nonlocal n n=2 pr 阅读全文
posted @ 2019-12-06 09:50 去遇见最好的自己 阅读(170) 评论(0) 推荐(0) 编辑
摘要:# 解压赋值 a,b = (1,2) print(a,b) # 1 2 # 交叉赋值 a = 1 b = 2 a,b = b,a print(a,b) # 2 1 # 按指定条件给字典排序 test = {'a':1,'b':3,'c':2} res = dict(sorted(test.items 阅读全文
posted @ 2019-12-06 09:30 去遇见最好的自己 阅读(156) 评论(0) 推荐(0) 编辑
摘要:# zip 将两个列表,对应位置的值拼接成元组,最后结果是一个列表套元组,注:不对应的值,会被舍弃. l1 = [1,1,3,6,7] l2 = [1,2,3,4] print(list(zip(l1,l2))) # [(1, 1), (2, 2), (3, 3), (6, 4)] # filter 阅读全文
posted @ 2019-12-04 15:26 去遇见最好的自己 阅读(209) 评论(0) 推荐(0) 编辑
摘要:修改头像 ajax上传图片,必须创建FormDate(),然后把图片加进去. ajax上传图片 $('#id_set_avatar_submit').click(function () { avatar_img = $('#id_avatar')[0].files[0]; var formData 阅读全文
posted @ 2019-11-19 21:55 去遇见最好的自己 阅读(188) 评论(0) 推荐(0) 编辑
摘要:from django.db import models from django.contrib.auth.models import AbstractUser # Create your models here. # 用户表 class UserInfo(AbstractUser): phone 阅读全文
posted @ 2019-11-18 21:37 去遇见最好的自己 阅读(826) 评论(0) 推荐(0) 编辑
摘要:# 在ORM中设置自关联字段 class Comment(models.Model): user = models.ForeignKey(to='UserInfo') article = models.ForeignKey(to='Article') content = models.CharFie 阅读全文
posted @ 2019-11-17 22:59 去遇见最好的自己 阅读(489) 评论(0) 推荐(0) 编辑
摘要:# 修改settings.py DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'test', 'HOST':'127.0.0.1', 'PORT':3306, 'USER':'root', 'PASS 阅读全文
posted @ 2019-11-17 21:22 去遇见最好的自己 阅读(3138) 评论(0) 推荐(1) 编辑
摘要:深浅拷贝 深浅copy 先问问大家,什么是拷贝?拷贝是音译的词,其实他是从copy这个英文单词音译过来的,那什么是copy? copy其实就是复制一份,也就是所谓的抄一份。深浅copy其实就是完全复制一份,和部分复制一份的意思。 1,先看赋值运算。 l1 = [1,2,3,['jason','ego 阅读全文
posted @ 2019-11-09 10:53 去遇见最好的自己 阅读(129) 评论(0) 推荐(0) 编辑

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