import os import sys import codecs import string def batch_rename(cfgname): # 获得目录下的所有文件 src_list = os.listdir("D:/picsample/picsample") print(src_lis ...
分类:
其他好文 时间:
2020-12-24 11:59:13
阅读次数:
0
{myproject}/websocket.py 1 # websocket.py 2 async def websocket_application(scope, receive, send): 3 while True: 4 event = await receive() 5 6 if even ...
分类:
Web程序 时间:
2020-12-24 11:39:43
阅读次数:
0
1 import pymysql 2 3 4 def mysql_db(sql): 5 # 连接数据库 6 db = pymysql.Connect(host='47.**.***.245', port=3306, user='***', password='***', db='***', 7 ch ...
分类:
数据库 时间:
2020-12-23 12:24:01
阅读次数:
0
1.使用vue脚手架创建的项目中有一个"components"文件夹,为了规范代码一般我们把控件放在这个文件夹中 2.在控件文件中布局(slot标签是插槽,在引用控件的时候使用template标签添加slot属性) <template> <div class="top"> <div class="t ...
分类:
其他好文 时间:
2020-12-23 12:20:29
阅读次数:
0
def sum(): sum = 0 for n in range(1, 101): sum = sum + n return sum print(sum()) ...
分类:
编程语言 时间:
2020-12-23 11:34:21
阅读次数:
0
2工厂模式 工厂模式 主要有 三种模式 1简单工厂模式(Simple Factory) 工厂方法模式(Factory Method) 抽象工厂模式(Abstract Factory) 说百了就是封装的意思方便很多 class Dingding: def __repr__(self): return ...
分类:
其他好文 时间:
2020-12-22 13:04:59
阅读次数:
0
模型: class LogisticQuerySet(QuerySet): def delete(self): self.update(is_delete=True) class BookManager(models.Manager): _queryset_class = LogisticQuery ...
分类:
其他好文 时间:
2020-12-22 12:59:22
阅读次数:
0
以生成斐波拉契数列为例 #!/usr/bin/python # -*- coding: UTF-8 -*- def fab(max): n, a, b = 0, 0, 1 while n < max: print b a, b = b, a + b n = n + 1 fab(5) 上面这种方法通过 ...
分类:
其他好文 时间:
2020-12-22 12:34:43
阅读次数:
0
skip:无条件跳过 @pytest.mark.skip 1 import pytest 2 3 class Test_One(): 4 @pytest.mark.skip 5 def test_01(self): 6 print(" > test_01") 7 8 def test_02(self ...
分类:
其他好文 时间:
2020-12-22 12:26:32
阅读次数:
0
1. Object.freeze()提升表格性能 Vue 初始化时会遍历 Vue 实例中 data对象所有的属性,并使用 Object.defineProperty 把这些属性全部转为 getter/setter,这些 getter/setter 对用户来说是不可见的 Vue为了双向数据绑定会给每个 ...
分类:
其他好文 时间:
2020-12-22 12:20:41
阅读次数:
0