From 3fde0d0b97edb1a9fb7caa00289984a28d90be7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Wed, 30 Dec 2020 16:50:11 +0800 Subject: [PATCH 01/36] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E5=91=A8-=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E8=8A=82-=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../job.py" | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202-\344\275\234\344\270\232/job.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202-\344\275\234\344\270\232/job.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202-\344\275\234\344\270\232/job.py" new file mode 100644 index 00000000..c8e2fcd0 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202-\344\275\234\344\270\232/job.py" @@ -0,0 +1,93 @@ +#for 循环计数 +a = 0 +for i in range(1, 101): + print(i) + a += 1 + + +#while 循环计数 +counter = 0 +while counter < 101: + print(f"sim statement:{counter}") + counter += 1 + + +#斐波那契函数 +#for 函数实现 +def F(n): + lst = [] + for i in range(n): + if i == 0 or i == 1: + lst.append(1) + else: + lst.append(lst[i - 1] + lst[i - 2]) + print(lst) + +F(10) + + +#while 函数实现 +def B(x): + a, b = 1, 1 + n= 1 + while n <= x: + result = a + a, b = b, a + b + n += 1 + yield result + +# 调用函数返回值是一个生成器,使用for循环遍历取值 +for i in B(11): + print(i) + + +#自定义异常 +def add(a, b): #加法运算 + return a + b + + +def subtract(c, d): #减法运算 + return c - d + + +def multiply(e, f): #乘法运算 + return e * f + + +def eliminates(g, h): #除法运算 + return g / h + + +def divide (o, p): #整除运算 + return o // p + + +def remainder(q, r): #取余运算 + return q % r + + +def sqr(s, t): #开方运算 + return s ** t + + +if __name__ == "__main__": + result1 = add(5, 6) + print(result1) + + result2 = subtract(5, 6) + print(result2) + + result3 = multiply(5, 6) + print(result3) + + result4 = eliminates(5, 6) + print(result4) + + result5 = divide(5, 6) + print(result5) + + result6 = remainder(5, 6) + print(result6) + + result7 = sqr(5, 6) + print(result7) \ No newline at end of file -- Gitee From d5614905c42c5f9bfd691036038fbb921d6985d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Wed, 30 Dec 2020 16:51:18 +0800 Subject: [PATCH 02/36] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E5=91=A8-=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E8=8A=82-=E4=BD=9C=E4=B8=9A=20=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...254\254\344\270\200\350\212\202-\344\275\234\344\270\232.py" | 2 +- .../job.py" | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202-\344\275\234\344\270\232/job.py" => "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/job.py" (100%) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_Super_Coding/week3/\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202-\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_Super_Coding/week3/\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202-\344\275\234\344\270\232.py" index fad44f2d..350a037b 100644 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_Super_Coding/week3/\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202-\344\275\234\344\270\232.py" +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_Super_Coding/week3/\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202-\344\275\234\344\270\232.py" @@ -1,6 +1,6 @@ # -*- coding: UTF-8 -*- """ -@File :第三周-第一节-作业.py +@File :第三周_第一节_作业.py @Author :Super @Date :2020/12/29 @Desc : diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202-\344\275\234\344\270\232/job.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/job.py" similarity index 100% rename from "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250-\347\254\254\344\270\200\350\212\202-\344\275\234\344\270\232/job.py" rename to "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/job.py" -- Gitee From f6fec88610913580a5954d2f3404df3d3328769d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Sat, 2 Jan 2021 23:09:57 +0800 Subject: [PATCH 03/36] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E5=91=A8-=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E8=8A=82-=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../job.py" | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/job.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/job.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/job.py" new file mode 100644 index 00000000..e9be8b68 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/job.py" @@ -0,0 +1,40 @@ +from pprint import pprint #格式化输出 +#根据grade排序 +classes = [ + {"name": "n_2", "age": 24, "grade": "B"}, + {"name": "n_3", "age": 27, "grade": "A"}, + {"name": "n_4", "age": 21, "grade": "C"}, + {"name": "n_5", "age": 25, "grade": "B"}, + {"name": "n_6", "age": 23, "grade": "D"}, + {"name": "n_7", "age": 26, "grade": "B"}, + {"name": "n_8", "age": 27, "grade": "A"}, + {"name": "n_9", "age": 20, "grade": "B"}, +] +classes.sort(key = lambda x: x['grade']) + +pprint(list(classes)) + + +#filter语句过筛选出grade A +f = filter(lambda x: True if x["grade"] == "A" else False, classes) +pprint(list(f)) + +# map 函数age + 1 +def age(item): + item['age'] = item['age'] + 1 + return item + +new_class = map(age, classes) +pprint(list(new_class)) + + + +#fibo 函数 +def Fibo(x): + if x <= 1: + return 1 + else: + return Fibo(x - 1) + Fibo(x - 2) + +for i in range(11): + print((Fibo(i))) -- Gitee From de3c2f87bc141f4fbe369c5b61011ed81113d7bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Mon, 4 Jan 2021 14:31:42 +0800 Subject: [PATCH 04/36] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E5=91=A8-=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E8=8A=82-=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../job.py" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/job.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/job.py" index e9be8b68..901680b5 100644 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/job.py" +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/job.py" @@ -37,4 +37,4 @@ def Fibo(x): return Fibo(x - 1) + Fibo(x - 2) for i in range(11): - print((Fibo(i))) + print((Fibo(i))) \ No newline at end of file -- Gitee From 1c77a2586974bcc4770286e438472fd249bdc55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Mon, 4 Jan 2021 22:32:42 +0800 Subject: [PATCH 05/36] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E5=91=A8-=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E8=8A=82-=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\344\275\234\344\270\232.py" | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" new file mode 100644 index 00000000..559cad86 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" @@ -0,0 +1,53 @@ +# 练习作用域之间的转换 +a = 5 + +def sum(): + global a #用 global 转换 + + a = 4 + print(a) + +sum() +print(a) + + +#用装饰器,输出函数的执行时间 +import time +def clock_it_deco(func): + def wrapper(*args, **kwargs): + start_time = time.time() + result = func(*args, **kwargs) + end_time = time.time() + print(f"{func.__name__} execute time: {format(end_time-start_time, '.2f')}s ") + return result + return wrapper + +@ clock_it_deco +def fact(n): #fact() 阶乘的意思 + if n == 1: + return 1 + else: + return n * fact(n - 1) +print(fact(10)) + + +# 用装饰器来为斐波那契函数添加缓存 +def cache_deco(func): + def wrapper(*args): + a = {} + if args not in a: + a[args] = func(*args) + return a[args] + + return wrapper + + +@ cache_deco # 调用 +def f(n): + if n <= 1: + return n + else: + return f(n - 1) + f(n - 2) + +for i in range(12): + print(f(i)) \ No newline at end of file -- Gitee From 76513b5ae388e83be6824650d6e1334c320a8c44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Tue, 5 Jan 2021 23:43:59 +0800 Subject: [PATCH 06/36] =?UTF-8?q?=E7=AC=AC=E4=B8=89=E5=91=A8-=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E8=8A=82-=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\344\275\234\344\270\232.py" | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" new file mode 100644 index 00000000..36bbdc25 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" @@ -0,0 +1,32 @@ +import datetime + +# 获取时间 +now = datetime.datetime.now(tz = None) + +#datetime.datetime -> str +now = datetime.datetime.now(tz = None) +print(now.strftime("%Y-%m-%d %H:%M:%S")) + +#str -> datetime.datetime +now = now.strftime("%Y-%m-%d %H:%M:%S") +print(datetime.datetime.strptime(now, "%Y-%m-%d %H:%M:%S")) + +#datetime.datetime -> timestamp +now = datetime.datetime.now(tz = None) +print(now.timestamp()) + +#timestamp -> datetime.datetime + +ts = now.timestamp() +print(datetime.datetime.fromtimestamp(ts, tz = None)) + + +def get_date(day_delta): + now = datetime.datetime.now(tz = None) + from datetime import timedelta + if day_delta == -1: + return now + timedelta(hours = -1) + else: + return now + +print(get_date(-1)) -- Gitee From 0ff43f1d70eb619b30395b2723ec7f863a037294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Tue, 5 Jan 2021 23:50:17 +0800 Subject: [PATCH 07/36] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E6=9C=9F=E8=AE=AD=E7=BB=83=E8=90=A5/2=E7=8F=AD/2?= =?UTF-8?q?=E7=8F=AD=5F=E5=B0=8F=E5=B1=8B/=E7=AC=AC=E5=9B=9B=E5=91=A8=5F?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E8=8A=82=5F=E4=BD=9C=E4=B8=9A/=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A.py=20=E4=B8=BA=20=E7=AC=AC=E4=BA=8C=E6=9C=9F=E8=AE=AD?= =?UTF-8?q?=E7=BB=83=E8=90=A5/2=E7=8F=AD/2=E7=8F=AD=5F=E5=B0=8F=E5=B1=8B/?= =?UTF-8?q?=E7=AC=AC=E5=9B=9B=E5=91=A8=5F=E7=AC=AC=E4=B8=80=E8=8A=82=5F?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A/=E7=AC=AC=E5=9B=9B=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E8=8A=82=5F=E4=BD=9C=E4=B8=9A.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...7\254\254\344\270\200\350\212\202_\344\275\234\344\270\232.py" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" => "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232.py" (100%) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232.py" similarity index 100% rename from "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" rename to "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232.py" -- Gitee From f34da26df92b6bb7687b432f683a6089e430bf3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Wed, 6 Jan 2021 00:09:53 +0800 Subject: [PATCH 08/36] =?UTF-8?q?update=20=E7=AC=AC=E4=BA=8C=E6=9C=9F?= =?UTF-8?q?=E8=AE=AD=E7=BB=83=E8=90=A5/2=E7=8F=AD/2=E7=8F=AD=5F=E5=B0=8F?= =?UTF-8?q?=E5=B1=8B/=E7=AC=AC=E4=B8=89=E5=91=A8=5F=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E8=8A=82=5F=E4=BD=9C=E4=B8=9A/=E4=BD=9C=E4=B8=9A.py.=20?= =?UTF-8?q?=E5=B7=B2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\344\275\234\344\270\232.py" | 4 ++++ 1 file changed, 4 insertions(+) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" index 559cad86..266d88aa 100644 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" @@ -38,6 +38,10 @@ def cache_deco(func): if args not in a: a[args] = func(*args) return a[args] + else: + result = func(*args) + a[args] = result + return result return wrapper -- Gitee From 4400c125812e134bbaf036642ca51f2b0d9d0027 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Wed, 6 Jan 2021 17:30:49 +0800 Subject: [PATCH 09/36] =?UTF-8?q?update=20=E7=AC=AC=E4=BA=8C=E6=9C=9F?= =?UTF-8?q?=E8=AE=AD=E7=BB=83=E8=90=A5/2=E7=8F=AD/2=E7=8F=AD=5F=E5=B0=8F?= =?UTF-8?q?=E5=B1=8B/=E7=AC=AC=E4=B8=89=E5=91=A8=5F=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E8=8A=82=5F=E4=BD=9C=E4=B8=9A/=E4=BD=9C=E4=B8=9A.py.=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B9=8B=E5=90=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\344\275\234\344\270\232.py" | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" index 266d88aa..da7a077c 100644 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\211\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/\344\275\234\344\270\232.py" @@ -33,15 +33,12 @@ print(fact(10)) # 用装饰器来为斐波那契函数添加缓存 def cache_deco(func): + a = {} def wrapper(*args): - a = {} if args not in a: - a[args] = func(*args) - return a[args] - else: - result = func(*args) - a[args] = result - return result + a[args] = func(*args) + + return a[args] return wrapper -- Gitee From 409d14d3092c2c8d6afce4166168a4a83fb9d8ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Wed, 6 Jan 2021 19:31:43 +0800 Subject: [PATCH 10/36] =?UTF-8?q?update=20=E7=AC=AC=E4=BA=8C=E6=9C=9F?= =?UTF-8?q?=E8=AE=AD=E7=BB=83=E8=90=A5/2=E7=8F=AD/2=E7=8F=AD=5F=E5=B0=8F?= =?UTF-8?q?=E5=B1=8B/=E7=AC=AC=E5=9B=9B=E5=91=A8=5F=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E8=8A=82=5F=E4=BD=9C=E4=B8=9A/=E7=AC=AC=E5=9B=9B=E5=91=A8=5F?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E8=8A=82=5F=E4=BD=9C=E4=B8=9A.py.=20?= =?UTF-8?q?=E5=B7=B2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...270\200\350\212\202_\344\275\234\344\270\232.py" | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232.py" index 36bbdc25..7c1fdac0 100644 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232.py" +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232.py" @@ -21,12 +21,13 @@ ts = now.timestamp() print(datetime.datetime.fromtimestamp(ts, tz = None)) +#封装一个函数`get_date(day_delta)`,如果传入的是`-1`,输出就是字符串日期`2020-01-05` def get_date(day_delta): - now = datetime.datetime.now(tz = None) + from datetime import timedelta - if day_delta == -1: - return now + timedelta(hours = -1) - else: - return now + now = datetime.datetime.now(tz=None) + now = now + timedelta(days = day_delta) + + print(f"{now.strftime('%Y-%m-%d')}") -print(get_date(-1)) +get_date(-1) \ No newline at end of file -- Gitee From e0b12eeb2070ea5e0a14bebca53dabad7bb5b97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Fri, 8 Jan 2021 16:57:51 +0800 Subject: [PATCH 11/36] =?UTF-8?q?=E7=AC=AC=E5=9B=9B=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson2.py" | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" new file mode 100644 index 00000000..4660fb79 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" @@ -0,0 +1,66 @@ +class MyMath(object): + object = 'number' + + + def add(self, a, b): #加法运算 + return a + b + + def sub(self, a, b): # 减法运算 + return a - b + + def mul(self, a, b): # 乘法运算 + return a * b + + def eli(self, a, b): # 除法运算 + return a / b + + def div(self, a, b): # 整除运算 + return a // b + + def rem(self, a, b): # 取余运算 + return a % b + + def sqr(self, a, b): # 开方运算 + return a ** b + + + + + +# 自由课题,创建多个实例 狗 +class Dog(): + def __init__(self): + self.eyes = 2 + self.feet = 4 + self.tail = 1 + +xiaohuang = Dog() + +xiaohei = Dog() + + + +#创建多个继承作业二 父类的子类 + +class SmallDog(Dog): + size = 'small' + +class MediumDog(Dog): + size = 'medium' + + +class LargeDog(Dog): + size = 'medium' + + +if __name__ == "__main__": + c = MyMath() + print(c.add(5, 6)) + print(c.sub(5, 6)) + print(c.mul(5, 6)) + print(c.eli(5, 6)) + print(c.div(5, 6)) + print(c.rem(5, 6)) + print(c.sqr(5, 6)) + print(xiaohuang) + print(xiaohei) -- Gitee From 40d1795a6a2a0a7d44fadf9aeb417ba1296c34dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Fri, 8 Jan 2021 17:00:43 +0800 Subject: [PATCH 12/36] =?UTF-8?q?=E7=AC=AC=E5=9B=9B=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson2.py" | 1 + 1 file changed, 1 insertion(+) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" index 4660fb79..aca8c116 100644 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" @@ -1,3 +1,4 @@ +#用类封装一个`MyMath` 类,实现加,减,乘,除,幂,开方. class MyMath(object): object = 'number' -- Gitee From 2a5bbce785fa87b305a59c27a4390c7a97df68ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Sun, 10 Jan 2021 18:37:19 +0800 Subject: [PATCH 13/36] =?UTF-8?q?=E7=AC=AC=E5=9B=9B=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson3.py" | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" new file mode 100644 index 00000000..a2669bce --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" @@ -0,0 +1,61 @@ +#实例方法改为静态方法. +class MyMath(object): + object = 'number' + + @staticmethod + def add(a, b): #加法运算 + return a + b + + def sub(a, b): # 减法运算 + return a - b + + def mul(a, b): # 乘法运算 + return a * b + + def eli(a, b): # 除法运算 + return a / b + + def div(a, b): # 整除运算 + return a // b + + def rem(a, b): # 取余运算 + return a % b + + def sqr(a, b): # 开方运算 + return a ** b + + +# 自由课题,创建多个实例 狗 +class Dog(): + animal = True # 添加类属性 + + __information = {'name': 'xiaohui', 'age': 4} #添加私有属性 + + def __init__(self): #初始化实例属性 + self.eyes = 2 #绑定实例属性 + self.feet = 4 + self.tail = 1 + + + @classmethod #添加类方法 + def get_information(cls): + return cls.__information + + + def __str__(self): + + return f"这是一只{self.__information}" + + +if __name__ == "__main__": + + print(MyMath.add(5, 6)) + + + d = Dog() + print(d.animal) # 添加类属性 + + print(Dog._Dog__information) #访问私有属性 + + print(d.get_information()) #获取类私有属性 + -- Gitee From 7d4be1fc42eebbd451544bbc360901ee3dbd3dba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Thu, 14 Jan 2021 21:06:01 +0800 Subject: [PATCH 14/36] =?UTF-8?q?=E7=AC=AC=E4=BA=94=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E8=8A=82=5F=E4=BD=9C=E4=B8=9A.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson1.py" | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.py" new file mode 100644 index 00000000..dc06cd2e --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.py" @@ -0,0 +1,55 @@ + +#利用python实现一个多线程程序 +#将多线程程序改为多进程程序 + +import requests +from threading import Thread +from multiprocessing import Process +import time + +#模拟请求哔哩哔哩 +def request_blibli(index): + + + url = "https://www.bilibili.com/" + headers = { + "user-agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit / 537.36 (KHTML, like Gecko) Chrome / 87.0.4280.88 Safari / 537.36" + } + response = requests.get(url = url, headers = headers) + print(response) + +#实现一个多线程程序 +#等待任务完成回到主进程 +if __name__ == "__main__": + thread_array = [] + start = time.clock() + + for i in range(10): + + t = Thread(target = request_blibli, args = (i,)) + thread_array.append(t) + t.start() + + for t in thread_array: + t.join() + + print("done") + + end = time.clock() + print(f"cpu执行时间: {end - start}") + +#将多线程改为多进程程序 + Process_array = [] + start = time.clock() + + for i in range(10): + p = Process(target = request_blibli, args = (i,)) + Process_array.append(p) + p.start() + + for p in thread_array: + p.join() + + print("done") + end = time.clock() + print(f"cpu执行时间: {end - start}") -- Gitee From a404082c751f92426847f6db7e2d89f8acf708fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Fri, 15 Jan 2021 15:35:56 +0800 Subject: [PATCH 15/36] =?UTF-8?q?update=20=E7=AC=AC=E4=BA=8C=E6=9C=9F?= =?UTF-8?q?=E8=AE=AD=E7=BB=83=E8=90=A5/2=E7=8F=AD/2=E7=8F=AD=5F=E5=B0=8F?= =?UTF-8?q?=E5=B1=8B/=E7=AC=AC=E4=BA=94=E5=91=A8=5F=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E8=8A=82=5F=E4=BD=9C=E4=B8=9A/lesson1.py.=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson1.py" | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.py" index dc06cd2e..100c865c 100644 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.py" +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.py" @@ -22,7 +22,7 @@ def request_blibli(index): #等待任务完成回到主进程 if __name__ == "__main__": thread_array = [] - start = time.clock() + start = time.time() for i in range(10): @@ -35,12 +35,12 @@ if __name__ == "__main__": print("done") - end = time.clock() + end = time.time() print(f"cpu执行时间: {end - start}") #将多线程改为多进程程序 Process_array = [] - start = time.clock() + start = time.time() for i in range(10): p = Process(target = request_blibli, args = (i,)) @@ -51,5 +51,5 @@ if __name__ == "__main__": p.join() print("done") - end = time.clock() + end = time.time() print(f"cpu执行时间: {end - start}") -- Gitee From d4e1ed8ceb5ae6909ac8efc696a5ae376e4d4702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Fri, 15 Jan 2021 22:10:58 +0800 Subject: [PATCH 16/36] =?UTF-8?q?=E7=AC=AC=E4=BA=94=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson2.py" | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" new file mode 100644 index 00000000..184a3b94 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" @@ -0,0 +1,68 @@ +#多进程锁,多线程锁都要实现一遍 +#多进程通过Queue来实现进程通信#把上述概念熟记并理解 + +import time +from multiprocessing import Process, Lock +from threading import Thread, Lock +from multiprocessing import Process, Queue +#多进程锁 +def save__file(index, Lock): + with Lock: + with open("第五周_第一节_作业.log", "a", encoding = "utf-8") as f: + f.write(str(index) + "\n") + +#多进程通过Queue来实现进程通信 + +def save_to_file(index, Lock): + with Lock: + with open("第五周_第一节_作业.log", "a", encoding = "utf-8") as f: + f.write(str(index) + "\n") + +def save_to_queue(index, my_queue): + my_queue.put(index) + +# 多线程锁 + +zero = 0 +lock = Lock() + +def foo(): + global zero + for i in range(10 ** 6): + with lock: + zero += 1 + zero -= 1 + + +if __name__ == "__main__": + process_array = [] + lock = Lock() + for i in range(10): + p = Process(target = save_to_file, args = (i, lock)) + process_array.append(p) + p.start() + for p in process_array: + p.join() + print("done!") + + process_array = [] + my_queue = Queue + for i in range(10): + p = Process(target=save_to_queue, args=(i, my_queue)) + process_array.append(p) + p.start() + for p in process_array: + p.join() + while True: + print(my_queue.get()) + + + thread_array = [] + for i in range(10): + t = Thread(target=foo) + process_array.append(t) + t.start() + for t in thread_array: + t.join() + print(zero) + -- Gitee From b41611c912c1856fce9815d6ac0f780063756491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Fri, 15 Jan 2021 22:13:52 +0800 Subject: [PATCH 17/36] =?UTF-8?q?=E7=AC=AC=E4=BA=94=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson2.py" | 7 +++++++ 1 file changed, 7 insertions(+) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" index aca8c116..b56f090d 100644 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\233\233\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" @@ -53,6 +53,13 @@ class MediumDog(Dog): class LargeDog(Dog): size = 'medium' +class poodle: + def __int__(self): + + print() + + + if __name__ == "__main__": c = MyMath() -- Gitee From 5e7ef7763980840c87431b50b028a7e847174cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Mon, 18 Jan 2021 01:22:40 +0800 Subject: [PATCH 18/36] =?UTF-8?q?=E7=AC=AC=E4=BA=94=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson3.py" | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" new file mode 100644 index 00000000..4dec913a --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\272\224\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" @@ -0,0 +1,50 @@ +#用协程实现计算平均数函数 +def coro_avg(): + total = 0 + length = 0 + while True: + #处理异常 + try: + value = yield total / length + except ZeroDivisionError: + value = yield 0 + total += value + length += 1 + +my_avg = coro_avg() +# 预激 +next(my_avg) +print(my_avg.send(2)) +print(my_avg.send(3)) +print(my_avg.send(4)) + + +#缩写一个asyncio异步程序 +import asyncio +import time +import requests + + +async def say_after_time(delay, what): + + await asyncio.sleep(delay) + print(what) + + +async def main(): + print(f"开始时间为: {time.time()}") + await say_after_time(1, "hello") + await say_after_time(2, "world") + print(f"结束时间为: {time.time()}") + + +#获取消息队列 +#loop = asyncio.get_event_loop() +#包装任务 +#task_array = [] +#for i in range(10): + #task_array.append(i) +#循环访问事件来完成异步的消息维护 +#loop.run_until_complete(asyncio.wait(*task_array)) +#关闭事件循环 +#loop.close -- Gitee From e43c1f96cf6665f337476c076ef367e150bff04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Wed, 20 Jan 2021 21:24:25 +0800 Subject: [PATCH 19/36] =?UTF-8?q?=E7=AC=AC=E5=85=AD=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson1.md" | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\255\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\255\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\255\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" new file mode 100644 index 00000000..82d12d8a --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\255\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" @@ -0,0 +1,33 @@ +浏览器地址栏敲下url发生了什么 +- 输入url +- 发送到DNS服务器,并获取域名对应的web服务器对应的IP地址 +- 浏览器向web服务器发送http请求 +- web服务器线响应请求,并指定返回的url的数据 +- 浏览器下载web服务器返回的数据及解析html源文件 +- 解析,渲染页面,直至显示完成 + +举例说明五层协议 +- 应用层 + 为客户端应用和服务器应用之间提供服务,应用层协议定义了应用之间进行数据交互的方式 + 例如:浏览网页, 网易云, 用python模拟请求 + +- 传输层 + 负责两个主机之间应用进程之间的通信服务 + 进程到进程之间 + TCP(传输控制协议)提供面向连接,可靠的数据传输服务,主要应用于文件传输,浏览网页 + UDP(用户数据协议)提供无连接的,不保证数据传输的可靠性(广播),主要应用于直播,实况游戏 + +- 网络层 + 决定了数据的转寄和路径选择,封装和分组运输层产生的报文段/用户数据段 + 主机到主机之间 + 协议 HTTP/HTTPS DNS FTP SMTP + +- 数据链路层 + 负责两台主机之间的数据传输 + 网卡到网卡之间 + 作用:数据流在传输媒介上传输时肯定有误差,数据链路层就是检错和纠错 + +- 物理层 + 物理层在局部局域网上传送数据帧,在设备节点传输数据流 + 光纤到光纤之间 + 作用:真正用来传输数据的 \ No newline at end of file -- Gitee From 612274ca0e6c19d0a83ea9dbef0ee48ff8e06681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Sun, 24 Jan 2021 21:55:02 +0800 Subject: [PATCH 20/36] =?UTF-8?q?=E7=AC=AC=E5=85=AD=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson2.md" | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\255\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.md" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\255\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.md" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\255\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.md" new file mode 100644 index 00000000..e2563a1a --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\255\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.md" @@ -0,0 +1,18 @@ +- 讲述TCP/IP三次握手 + - 客户端向服务端发送带有SYN(同步序列编码)标识的数据包,服务端确认了客户端的发送能力正常 + - 服务端向客户端发送了带有SYN-ACK(确认字符),服务端确认了接收能力正常 + - 客户端向服务端返回带有ACK标识的数据包,服务端确认了自己收发能力,客户端接收正常 + +- 讲述TCP/IP四次挥手 + - 客户端向服务端发送了一个FIN(finish)数据包,关闭客户端到服务端的连接通道 + - 服务端收到FIN后,返回了ACK数据包,服务端已经知道了客户端到服务端的连接通道已关闭 + - 服务端发送FIN至客户端,关闭与客户的连接,目的是关闭服务端到客户端的连接通道 + -客户端返回ACK数据包确认,通知服务端客户端已经知道了服务端与客户端之间的连接通道已关闭 + +- HTTPS加密过程 + - 客户端向服务端发送请求 + - 服务端返回给客户端证书和密钥 + - 客户端通过CA中心验证证书的真实性 + - 客户端完成认证之后,使用公钥对发送的数据进行加密,发送给服务端 + - 服务端收到加密后的请求数据后,使用私钥进行解密 + - 服务端与客户端使用对称加密进行通信 \ No newline at end of file -- Gitee From 7ad6072e446bb6c0918f23fafbfe00d8d78d3437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Sun, 24 Jan 2021 22:01:01 +0800 Subject: [PATCH 21/36] =?UTF-8?q?=E7=AC=AC=E5=85=AD=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson3.md" | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\255\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.md" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\255\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.md" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\255\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.md" new file mode 100644 index 00000000..2bc0eb50 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\255\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.md" @@ -0,0 +1,97 @@ +# 第六周-第三节 + +## 抓包 + +抓包其实就是中间人攻击,只是我们会主动信任像`fiddier`这样的代理软件 + +中间人攻击:对于服务端伪装成客户端,对于客户端伪装成服务端 + +**使用工具提升效率**(唯一要求,记住安装地址) + +- 抓包软件 + + - `fiddier`(免费,尽量使用) + - `Charies`(收费) + +- web抓包 + + 现代互联网几乎都是`https`协议的网站 + + - 信任证书 + + ``` + Rules -> Options -> HTTPS + - 勾选Decrypt HTTPS traffic + - 右上角点击Actions + - Trust Root Certificates + ``` + + - `CONNECTs`三次握手,四次挥手的一些过程 + + - Non - 200s 清除掉一些错误的请求 + + - Non - Browser + +- `App`抓包 + + ``` + 下载夜神模拟器 + ``` + + - 打开远程终端 + + ``` + Rules -> Options -> Connections -> Allow remote computes to connect + ``` + + - 把手机/模拟器的代理指向`fiddier` + + ``` + - wifi 调出设置的时候要长按 + - 查看当前fiddier所在pc本地局域ip + - ipconfig + - 在代理中填写IP地址和fiddier端口,默认是8888 + ``` + + ``` + 无线局域网适配器 WLAN 2: + + 连接特定的 DNS 后缀 . . . . . . . : + 本地链接 IPv6 地址. . . . . . . . : fe80::ed10:8f0c:6e7a:7f4b%22 + IPv4 地址 . . . . . . . . . . . . : 192.168.8.187 + 子网掩码 . . . . . . . . . . . . : 255.255.255.0 + 默认网关. . . . . . . . . . . . . : 192.168.8.1 + + ``` + + - 信任证书 + + - `App`有一定的反爬措施,第一件事就是修改请求协议 + + - 双向验证 + + 需要客户端也带上证书 + + - 解决请求协议上的反爬措施 + + - 安装`VirtuaLxposed`, `JustTrustMe` + +## 模拟请求 + +- Postman简单使用 + + - GET + + - POST + + - from_date + + 参数表单 + + - `x-www-from-urlencoded` + + 如果headers中content-type为`x-www-from-urlencoded`,那么我们需要在当前选项下填写参数 + + - raw + + 请求的真实body内容 \ No newline at end of file -- Gitee From ccffb5e49df6908f6410606ec4fff88bab444d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Fri, 29 Jan 2021 23:46:50 +0800 Subject: [PATCH 22/36] =?UTF-8?q?=E7=AC=AC=E4=B8=83=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\350\212\202_\344\275\234\344\270\232.md" | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\203\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\347\254\254\344\270\203\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232.md" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\203\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\347\254\254\344\270\203\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232.md" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\203\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\347\254\254\344\270\203\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232.md" new file mode 100644 index 00000000..c5ae79dd --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\203\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/\347\254\254\344\270\203\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232.md" @@ -0,0 +1,35 @@ + - 什么是关系型数据表,什么是非关系型数据表,他们又什么区别,各有什么应用场景 + + - 关系型数据库 + - 创建在关系模型上的数据库,用来存储和管理结构化的数据 + + - 非关系型数据库 + - 创建在Nosql系统存储基础上的数据库,Nosql既可以存储数据化的数据,也可以存储非结构化的数据 + - 区别 + - 1.成本:Nosql数据库很容易部署,基本是开源软件,比关系型数据库便宜 + - 2.查询速度:Nosql数据库将数据存储在高速缓存中,不需要SQL层进行分析.关系数据库在硬盘上存储数据,自然的查询速度远比Nosql数据慢 + - 3.存储数据的格式:Nosql的存储格式是键对值形式,文档形式,图片形式等,所以存储基础类型以及对象或者是集合等各种形式,而数据库则只支持基础类型 + - 4.扩展性:关系型数据库有类似jion(联结)这样的多表查询机制的限制导致扩展很难.Nosql基于键值对,数据之间没有耦合性,所以非常容易水平扩展 + - 5.持久存储:Nosql不使用于持久存储,海量数据的持久存储,还是需要关系型数据库 + - 6.数据一致性:非关系型数据库通常强调数据的最终一致性,而不是像关系数据库那样强烈的数据一致性,以及非关系型数据库读取的数据可能仍处于中间状态,Nosql不提供对事务的处理 + + - 关系型数据库应用场景 + - 需要复杂处理的数据 + - 数据量不是特别大的数据 + - 对安全性要求高的数据 + - 数据格式单一的数据 + + - Nosql应用场景 + - 海量数据存储 + - 多格式的数据存储 + - 对查询速度要求快的数据存储 + +- 什么是事务,事务的特点 + - 把多条语句作为一个整体进行操作的功能,被称为数据库事务.数据库事务可以确保该事务范围内的所有操作都可以全部成功或者全部失败 + - 特性 ACID + - Atomic,原子性 指事物的操作是不可分割的,要么完成,要么不完成,不存在其他的中间态 + - Consistence,一致性 事务A和事务B同时运行,数据库都会达到一致 + - Isolation,隔离性 解决多个事务同时对数据进行读写和修改得能力 + - Duration,当某个事务一旦提交,无论数据库崩溃还是其他原因,该事务的结果都能被持久的保存下来 + + \ No newline at end of file -- Gitee From 90d2a1cd5cc68cc3bcc1436670a6d4e1e49318c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Sun, 31 Jan 2021 22:26:07 +0800 Subject: [PATCH 23/36] =?UTF-8?q?=E7=AC=AC=E4=B8=83=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson2" | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\203\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\203\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\203\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2" new file mode 100644 index 00000000..8affa2b8 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\203\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2" @@ -0,0 +1,30 @@ +insert into job1(int_field, bigint_field, float_field, double_field, decimal_field) values(1234567890, 12345678901234567.9, 123.1231231, 123123123123123, 34523512312432534534534234); + +#算术运算 +select sum(float_field) from job1 +select avg(float_field) from job1 +select count(float_field) from job1 + +#字符处理 +select CHAR_LENGTH("test") +select format(0.123456, 2) +select right(0.123456, 3) +select left(0.123456, 3) +select trim('abcdefg ') + +#算数运算符 +select 1 + 1 +select 2 - 1 +select 2 * 3 +select 2 / 3 +select 5 div 3 #取商 +select 5 mod 3 #取余 + +#比较运算符 +select 2 = 2 +select 2 != 3 +select 2 > 3 +select 1 < 2 < 3 +select 2 between 1 and 3 +select 2 not between 1 and 3 + -- Gitee From e03e0ce98d3ad39f7118d5f56b51211632c6b39c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Mon, 1 Feb 2021 00:25:07 +0800 Subject: [PATCH 24/36] =?UTF-8?q?=E7=AC=AC=E4=B8=83=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson3.py" | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\203\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\203\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\203\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" new file mode 100644 index 00000000..316b4938 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\344\270\203\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" @@ -0,0 +1,74 @@ +#CRUD操作 +#Creat +insert into test_biao(name) values ('name_1'), ('name_2') + +#Retrieve +select * from test_biao # 获取所有记录 + +select * from test_biao where name = "name_1" and id = 1 or id = 2 # 条件查询 + +select * from test_biao where name like "n%" #模糊匹配 + +select * from test_biao where name like "n%" limit 3 #限制返回条数 + +select distinct name, creat_time from test_biao # 过滤重复值 + +select name, creat_time from test_biao order by creat_time # 升序(默认) + +select id creat_time from test_biao order by creat_time desc # 降序 + +select count(*) from test_biao order by creat_time desc # 获取查询结果条数 + +# Update +update test_biao set name = 'name_0' where id = 1 + +#Delete + +delete from test_biao where name = 'name_0' + +#集合操作 +#并集 +select name from test_biao where name is not null +union +select name from test_biao1 where name is not null + +#交集 +select A.name from +(select name from test_biao where name is not null) as A +join +(select name from test_biao1 where name is not null) as B +on A.name = B.name + +#差集 +#A对B的差集 +select A.name from +(select name from test_biao where name is not null) as A +left join +(select name from test_biao1 where name is not null) as B +on A.name = B.name +where B.name is null + +# B对A的差集 +select B.name from +(select name from test_biao where name is not null) as A +right join +(select name from test_biao1 where name is not null) as B +on A.name = B.name +where A.name is null + +#补集 +select A.name from +(select name from test_biao where name is not null) as A +left join +(select name from test_biao1 where name is not null) as B +on A.name = B.name +where B.name is null + +union + +select B.name from +(select name from test_biao where name is not null) as A +right join +(select name from test_biao1 where name is not null) as B +on A.name = B.name +where A.name is null \ No newline at end of file -- Gitee From de143673e339baa50154a5f86e324ca43a5e05cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Sun, 7 Feb 2021 20:35:06 +0800 Subject: [PATCH 25/36] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=E7=AC=AC=E5=85=AB?= =?UTF-8?q?=E5=91=A8=5F=E7=AC=AC=E4=B8=80=E8=8A=82=5Fzuoye?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_zuoye/.keep" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_zuoye/.keep" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_zuoye/.keep" new file mode 100644 index 00000000..e69de29b -- Gitee From b312c6557f2587dab66031929b356fd00d564b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Sun, 7 Feb 2021 20:37:00 +0800 Subject: [PATCH 26/36] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D=20=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E6=9C=9F=E8=AE=AD=E7=BB=83=E8=90=A5/2=E7=8F=AD/2?= =?UTF-8?q?=E7=8F=AD=5F=E5=B0=8F=E5=B1=8B/=E7=AC=AC=E5=85=AB=E5=91=A8=5F?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E8=8A=82=5Fzuoye=20=E4=B8=BA=20=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E6=9C=9F=E8=AE=AD=E7=BB=83=E8=90=A5/2=E7=8F=AD/2?= =?UTF-8?q?=E7=8F=AD=5F=E5=B0=8F=E5=B1=8B/=E7=AC=AC=E5=85=AB=E5=91=A8=5F?= =?UTF-8?q?=E7=AC=AC=E4=B8=80=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_zuoye/.keep" => "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/.keep" (100%) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_zuoye/.keep" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/.keep" similarity index 100% rename from "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_zuoye/.keep" rename to "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/.keep" -- Gitee From 2f161c193fc17a1f99877faa48db34d76f8a2e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Sun, 7 Feb 2021 20:37:33 +0800 Subject: [PATCH 27/36] =?UTF-8?q?add=20=E7=AC=AC=E4=BA=8C=E6=9C=9F?= =?UTF-8?q?=E8=AE=AD=E7=BB=83=E8=90=A5/2=E7=8F=AD/2=E7=8F=AD=5F=E5=B0=8F?= =?UTF-8?q?=E5=B1=8B/=E7=AC=AC=E5=85=AB=E5=91=A8=5F=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E8=8A=82=5F=E4=BD=9C=E4=B8=9A.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson1.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" new file mode 100644 index 00000000..e69de29b -- Gitee From 9c1ffcfc3bd8adb58de20a86c196d9f34bf20dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Sun, 7 Feb 2021 20:57:06 +0800 Subject: [PATCH 28/36] =?UTF-8?q?update=20=E7=AC=AC=E4=BA=8C=E6=9C=9F?= =?UTF-8?q?=E8=AE=AD=E7=BB=83=E8=90=A5/2=E7=8F=AD/2=E7=8F=AD=5F=E5=B0=8F?= =?UTF-8?q?=E5=B1=8B/=E7=AC=AC=E5=85=AB=E5=91=A8=5F=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E8=8A=82=5F=E4=BD=9C=E4=B8=9A/lesson1.md.=20=E7=AC=AC=E5=85=AB?= =?UTF-8?q?=E5=91=A8=5F=E7=AC=AC=E4=B8=80=E8=8A=82=5F=E4=BD=9C=E4=B8=9A/le?= =?UTF-8?q?sson1.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson1.md" | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" index e69de29b..b5583355 100644 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" @@ -0,0 +1,16 @@ + +![输入图片说明](https://images.gitee.com/uploads/images/2021/0207/204345_d85279e3_8431044.png "mysql约束.png") + +![输入图片说明](https://images.gitee.com/uploads/images/2021/0207/204407_12a53ce5_8431044.png "分组查询.png") + +使用场景 +- 主键约束 + - 数据库两行记录数据完全一样,如何区分,这时就需用到主键 +- 默认值约束 + - 常用于一些可有可无的字段,比如用户的签名,用户没有设置,系统应该设定一个默认的文本 +- 唯一值约束 + - 规定一张表中指定的一列的值必须不能有重复值,既这一列每个值都是唯一的 +- 外键值约束 + -一个表可以有多个外键,每个键必须参考另一个表的主键,被外键约束的列,取值必须在它参考的列中有对应值 +- 非空约束 + - 只能约束程序层面上没有操作该表中的某个字段,不能约束人行为上对其赋值为空白字符 \ No newline at end of file -- Gitee From 0c36bbc0b26de961ae2af030e4dd7d77939b3ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Sun, 7 Feb 2021 20:59:09 +0800 Subject: [PATCH 29/36] =?UTF-8?q?update=20=E7=AC=AC=E4=BA=8C=E6=9C=9F?= =?UTF-8?q?=E8=AE=AD=E7=BB=83=E8=90=A5/2=E7=8F=AD/2=E7=8F=AD=5F=E5=B0=8F?= =?UTF-8?q?=E5=B1=8B/=E7=AC=AC=E5=85=AB=E5=91=A8=5F=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E8=8A=82=5F=E4=BD=9C=E4=B8=9A/lesson1.md.=20=E7=AC=AC=E5=85=AB?= =?UTF-8?q?=E5=91=A8=5F=E7=AC=AC=E4=B8=80=E8=8A=82=5F=E4=BD=9C=E4=B8=9A/le?= =?UTF-8?q?sson1.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson1.md" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" index b5583355..5a9ca477 100644 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" @@ -1,6 +1,6 @@ - + **简单使用mysql约束** ![输入图片说明](https://images.gitee.com/uploads/images/2021/0207/204345_d85279e3_8431044.png "mysql约束.png") - + **分组查询** ![输入图片说明](https://images.gitee.com/uploads/images/2021/0207/204407_12a53ce5_8431044.png "分组查询.png") 使用场景 -- Gitee From 9279f0edb9fb289d6bf150657305d71c994a703b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Sun, 7 Feb 2021 20:59:46 +0800 Subject: [PATCH 30/36] =?UTF-8?q?update=20=E7=AC=AC=E4=BA=8C=E6=9C=9F?= =?UTF-8?q?=E8=AE=AD=E7=BB=83=E8=90=A5/2=E7=8F=AD/2=E7=8F=AD=5F=E5=B0=8F?= =?UTF-8?q?=E5=B1=8B/=E7=AC=AC=E5=85=AB=E5=91=A8=5F=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E8=8A=82=5F=E4=BD=9C=E4=B8=9A/lesson1.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson1.md" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" index 5a9ca477..8b5a0fa8 100644 --- "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\200\350\212\202_\344\275\234\344\270\232/lesson1.md" @@ -1,6 +1,6 @@ - **简单使用mysql约束** +**简单使用mysql约束** ![输入图片说明](https://images.gitee.com/uploads/images/2021/0207/204345_d85279e3_8431044.png "mysql约束.png") - **分组查询** +**分组查询** ![输入图片说明](https://images.gitee.com/uploads/images/2021/0207/204407_12a53ce5_8431044.png "分组查询.png") 使用场景 -- Gitee From 47895a0a6be69a5dec56e815d90635bd5356ed04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Sun, 7 Feb 2021 23:26:29 +0800 Subject: [PATCH 31/36] =?UTF-8?q?=E7=AC=AC=E5=85=AB=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson2.py" | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" new file mode 100644 index 00000000..bcfac8b1 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\272\214\350\212\202_\344\275\234\344\270\232/lesson2.py" @@ -0,0 +1,58 @@ +#- 重点掌握用户变量,练习变量的赋值和使用 +#- 练习存储过程(能自行完整的写出一个函数) +#- 练习触发器(只要求操作几次) + +SHOW VARIABLES + +#通过@@来调用系统变量 +SELECT @@date_format + +#用户变量 +SELECT @yesterday + +#用set对变量进行赋值 +set @yesterday = subdate(CURRENT_DATE, 2); +SELECT @yesterday + +#日期的格式化 +set @yesterday = subdate(CURRENT_DATE, 2); +set @yesterday = DATE_FORMAT(@yesterday,"%Y/%m/%d"); +SELECT @yesterday + +#小数的格式化 +set @amount = 0.4; +set @amount = CAST(@amount as DECIMAL(15, 3)); +select @amount + +#创建存储过程 +CREATE PROCEDURE stat_store_perf(days INT) +BEGIN + DECLARE t_date VARCHAR(255); + set t_date = DATE_FORMAT(subdate(CURRENT_DATE, days), '%Y-%m-%d'); + SELECT count(*) as 店铺数, + FORMAT(AVG(amount), 2) as 平均数, + SUM(amount) as 总业绩, + MAX(amount) as 最大业绩, + MIN(amount) as 最小业绩, + department as 部门 + FROM store_perf WHERE sta_date = t_date + GROUP BY department; +END + +#调用存储过程 +CALL stat_store_perf(1) + +#删除存储过程 +DROP PROCEDURE stat_store_perf + + +触发器 +CREATE TRIGGER check_deparment +BEFORE INSERT +ON store_perf +FOR each row +BEGIN + IF new.deparment not in ("男装事业部", "女装事业部") THEN + SET new.deparment = 'unknow'; + END IF; +END \ No newline at end of file -- Gitee From ddcd2e37927838227a5932ad2829be4ec382e62d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Mon, 8 Feb 2021 21:16:11 +0800 Subject: [PATCH 32/36] =?UTF-8?q?=E7=AC=AC=E5=85=AB=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=B8=89=E8=8A=82=5F=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lesson3.py" | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" new file mode 100644 index 00000000..328dd11c --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/\347\254\254\345\205\253\345\221\250_\347\254\254\344\270\211\350\212\202_\344\275\234\344\270\232/lesson3.py" @@ -0,0 +1,102 @@ +import pymysql +import random +import time + +MYSQL_CONF = { + "host" : "127.0.0.1", + "user" : "root", + "password" : "2596070293h", + "db" : "learning" +} + +#连接数据库 +mysql_con = pymysql.connect(**MYSQL_CONF) + +#简单理解真正执行语句的线程 +mysql_cursor = mysql_con.cursor() + +def clock_it_deco(func): + def wrapper(*args, **kwargs): + start_time = time.time() + result = func(*args, **kwargs) + end_time = time.time() + print(f"{func.__name__} execute time: {format(end_time-start_time, '.2f')}s ") + return result + return wrapper + +@clock_it_deco +def insert_one(): + for i in range(10 ** 4): + store_name = f"店铺_{i}" + amount = format(random.uniform(10**3, 10**6), '.2f') + department = f"事业部_{random.randint(1, 10)}" + sta_date = time.strftime("%Y-%m-%d") + + SQL = f"""INSERT INTO store_perf(store_name, amount, department, sta_date) + values ('{store_name}', {amount}, '{department}', '{sta_date}')""" + print(SQL) + mysql_cursor.execute(SQL) + + # 显示执行commit,避免cursor执行,但是数据库未收到的执行指令的情况 + mysql_con.commit() + + + +@clock_it_deco +def insert_many(): + values = [] + for i in range(10 ** 6): + store_name = f"店铺_{i}" + amount = format(random.uniform(10**3, 10**6), '.2f') + department = f"事业部_{random.randint(1, 10)}" + sta_date = time.strftime("%Y-%m-%d") + values.append((store_name, amount, department, sta_date)) + + SQL = """INSERT INTO store_perf(store_name, amount, department, sta_date) + values (%s, %s, %s, %s)""" + #print(values) + mysql_cursor.executemany(SQL, values) + mysql_con.commit() + +def get_shops(): + SQL = "select store_name from store_perf where department = '事业部_1' LIMIT 2" + mysql_cursor.execute(SQL) + query_set = mysql_cursor.fetchall() + print(query_set) + + +def transaction(): + try: + SQL = "DELETE FROM test_biao1 where name = 'name_13'" + mysql_cursor.execute(SQL) + SQL_2 = "INSERT INTO test_baio1 VALUES(name)" + + except Exception as e: + print("raise Exceptions", e.args[0]) + print("rollback") + mysql_con.rollback + + finally: + mysql_con.commit() + +if __name__ == "__main__": + #insert_one() + #insert_many() + #get_shops() + transaction() + + + +#索引的创建 +#SELECT * FROM store_perf WHERE store_name = '店铺_654321' + +#CREATE INDEX store_name_index on store_perf(store_name) + +#查看索引 +#SHOW INDEX FROM store_perf + +#删除索引 +#ALTER TABLE store_perf DROP INDEX store_name_index + +#查看命中索引 +#EXPLAIN SELECT * FROM store_perf WHERE store_name = '店铺_654321' \ No newline at end of file -- Gitee From 46cf1329cc653961b76741c303a2e48f2ea45f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Fri, 5 Mar 2021 22:53:57 +0800 Subject: [PATCH 33/36] =?UTF-8?q?=E7=AC=AC=E4=B9=9D=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E8=8A=82=5F=E4=BD=9C=E4=B8=9A.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../week9/lesson1.py" | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/lesson1.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/lesson1.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/lesson1.py" new file mode 100644 index 00000000..c6807f9f --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/lesson1.py" @@ -0,0 +1,71 @@ +#京东搜索页面的请求 + +import requests +from urllib.parse import quote, unquote + + +def request_jd(keyword): + f = open(keyword + ".html", "w", encoding = "utf-8") + url = "https://search.jd.com/Search" + params = { + "keyword": keyword + } + headers = { + "user-agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36" + } + + + response = requests.get(url=url, params=params, headers=headers) + f.write(response.text) + f.close() + + print(response.text) + + +if __name__ == "__main__": + request_jd("Ipad") + print(quote("Ipad")) + + +#京东详情页面的请求 + +import requests +from urllib.parse import quote, unquote + +def requests_jd_details(keyword): + f = open("details.html", "w", encoding = "utf-8") + url = "https://item.jd.com" + + params = { + "keyword" : keyword + } + headers = { + "user - agent": "Mozilla / 5.0(Windows NT 10.0; WOW64) AppleWebKit / 537.36 (KHTML, like Gecko) Chrome / 88.0.4324.96 Safari / 537.36" + } + + response = requests.get(url=url, params=params, headers=headers) + + f.write(response.text) + f.close() + print(response.text) + + +if __name__ == "__main__": + requests_jd_details("AppleIpad") + + +#完成json练习 +import json + +test_dict = { + "a" : 1, + "b" : {"1", 2, None}, + "c" : {"d" : 1} +} +#json格式数据其实是个字符串 +#将python字典转换为json格式 +json_data = json.dumps(test_dict) +print(type(json_data), json_data) + +#将json数据格式转换为字典 +print(json.loads(json_data)) -- Gitee From e413dbff9bf07caba441ebabb6c040759167eba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Fri, 5 Mar 2021 22:57:46 +0800 Subject: [PATCH 34/36] =?UTF-8?q?=E7=AC=AC=E4=B9=9D=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E8=8A=82=5F=E4=BD=9C=E4=B8=9A.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../week9/Ipad.html" | 2891 +++++++++++++++++ .../week9/details.html" | 857 +++++ 2 files changed, 3748 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/Ipad.html" create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/details.html" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/Ipad.html" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/Ipad.html" new file mode 100644 index 00000000..5d97a1cd --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/Ipad.html" @@ -0,0 +1,2891 @@ + + + + + + + + + + + + + + + + + + + + +Ipad - 商品搜索 - 京东 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+
+ +
+
+ +
+ + +
+
+
+
+ + + 我的购物车 +
+
+
+
+ +
+
+
+
+ +
+ + +
+ + +
+
+
+
+ +
+ > + 品牌:Apple +
+ "Ipad" +
+
+
+
+ +
+ +
+ +
+
+
电脑整机:
+
+
+ +
+
+ 确定 + 取消 +
+
+
+ 更多 + +
+
+
+ +
+
+
二手电脑整机:
+ +
+ 更多 + +
+
+
+ +
+
+
屏幕尺寸:
+
+
+ +
+
+ 确定 + 取消 +
+
+
+ 更多 + 多选 +
+
+
+
+
+
存储容量:
+
+
+ +
+
+ 确定 + 取消 +
+
+
+ 更多 + 多选 +
+
+
+
+
+
尺寸:
+ +
+ 更多 + 多选 +
+
+
+
+
+
高级选项:
+ +
+ + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+
+ +
+ + + + + +
+
+
+
+ - +
+
+
+ + 清空 + 确定 +
+
+
+ + 1/100 + + < + > +
+
3.8万+件商品
+ +
+
+
+
配送至
+
+
+
北京
+ +
+
+
+
+
+
+
+ + +
+
+ + +
+ + + +
+
正在加载中,请稍后~~
+
+
+
+
+
+
+ +

商品精选

+
+
    +
+
+
+

精品推荐

+ +
+
+ +
+ + +
+
+
+
+
+ +
商品精选
+
+
+
+
+ +
+
+
+
+ +
+
+
    +
  1. + 品类齐全,轻松购物 +
  2. +
  3. + 多仓直发,极速配送 +
  4. +
  5. + 正品行货,精致服务 +
  6. +
  7. + 天天低价,畅选无忧 +
  8. +
+
+
+
+
+
+
购物指南
+
+ 购物流程 +
+
+ 会员介绍 +
+
+ 生活旅行/团购 +
+
+ 常见问题 +
+
+ 大家电 +
+
+ 联系客服 +
+
+
+
配送方式
+
+ 上门自提 +
+
+ 211限时达 +
+
+ 配送服务查询 +
+
+ 配送费收取标准 +
+
+ 海外配送 +
+
+
+
支付方式
+
+ 货到付款 +
+
+ 在线支付 +
+
+ 分期付款 +
+
+ 公司转账 +
+
+
+
售后服务
+
+ 售后政策 +
+
+ 价格保护 +
+
+ 退款说明 +
+
+ 返修/退换货 +
+
+ 取消订单 +
+
+
+
特色服务
+
+ 夺宝岛 +
+
+ DIY装机 +
+
+ 延保服务 +
+
+ 京东E卡 +
+
+ 京东通信 +
+
+ 京鱼座智能 +
+
+ +
+
+
+
+ + +
+ + + + + diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/details.html" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/details.html" new file mode 100644 index 00000000..f13cdc3c --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/details.html" @@ -0,0 +1,857 @@ + + + + + + 京东(JD.COM)-正品低价、品质保障、配送及时、轻松购物! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+
+
    + +
+ + +
+
+ + + +
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + +
+
+
+ +
+ 京东开放平台 + 商羚 + 京东零售云 + 氢舟 + 京东家医 + 家庭医生 + 东联计划 + 网络赚钱 + 青少年牙刷 + 洗面奶 + 唐狮拼色 连衣裙 + 苹果手机 + 琵琶 + 女士鞋 + 实木沙发 + 索尼电视 + 卫浴品牌 + 奥克斯空调 + 百香果 + 索尼耳机 + 尊贵十字对开门直冷冰箱 + SKG十字对开门风冷冰箱 + 美菱冰箱下乡产品 + 美的抽屉冰箱 + 美菱(MeiLing)冰箱 + 冰箱出水口在哪里 + 海尔(haier)bcd-186kb + 95升单门冰箱 + 容声十字门变频冰箱 + 468FDBB + 海尔冰箱266 + 海尔冰箱分期 + 对开门冰箱博世 + 迷你型冰箱 + 食物串味?多门冰箱让生活更简单 + 松下621哪款好?松下621怎么样好用吗? + 药品的储藏方法 + 电冰箱为何突然灯不亮 你是否真的了解 + 多门冰箱MeiLing排行榜,多门冰箱MeiLing十大排名推荐 + 新飞183哪款好?新飞183怎么样好用吗? +
+ + + + +
+ + + + + + + + + +
+ + + + + + + + + + + -- Gitee From aae4da7620c2474e37f0eea03cb4fd8f264755fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Sat, 6 Mar 2021 09:40:40 +0800 Subject: [PATCH 35/36] =?UTF-8?q?=E7=AC=AC=E4=B9=9D=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E8=8A=82=5F=E4=BD=9C=E4=B8=9A.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../week9/lesson2.py" | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/lesson2.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/lesson2.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/lesson2.py" new file mode 100644 index 00000000..d7cfbfde --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/lesson2.py" @@ -0,0 +1,21 @@ +from bs4 import BeautifulSoup + +def jd_search_parse(html): + html = html.replace('\r\n', "").replace("\n", "").replace("\t", "") + soup = BeautifulSoup(html, "lxml") + item = soup.select("li[data-sku^='2']")[0] + print(item.next_sibling.next_sibling) + print(item.previous_sibling) + print(item.next.sibling) + print(item.parent) + print(item.children) + content = item.text.strip() + value = item.attrs["data-sku"] + + + + +if __name__ == "__main__": + with open("jd_search.html", "r", encoding="utf-8") as f: + html = f.read() + jd_search_parse(html) \ No newline at end of file -- Gitee From bccf08a92ebce4125b34fa30bca86509f754cde1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=B1=8B?= <15129457085@163.com> Date: Sat, 6 Mar 2021 09:41:21 +0800 Subject: [PATCH 36/36] =?UTF-8?q?=E7=AC=AC=E4=B9=9D=E5=91=A8=5F=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E8=8A=82=5F=E4=BD=9C=E4=B8=9A.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../week9/jd_search.html" | 2552 +++++++++++++++++ 1 file changed, 2552 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/jd_search.html" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/jd_search.html" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/jd_search.html" new file mode 100644 index 00000000..c8b6ed35 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/2\347\217\255/2\347\217\255_\345\260\217\345\261\213/week9/jd_search.html" @@ -0,0 +1,2552 @@ + + + + + + + + + + + + + + + + + + + + + +Ipad - 商品搜索 - 京东 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+ + 0 + 我的购物车 +
+
+
+
ipad2020|ipadpro|ipad air|华为平板|平板电脑|ipad mini|ipad mini5|平板|ipad air3|ipad2019|ipad air4|华为|iphone12|iphone
+ +
+ + +
+ + +
+
+
+
+ +
+ > + 品牌:Apple +
+ "Ipad" +
+
+
+
+ +
+ +
+ +
+
+
电脑整机:
+
+
+ +
+
+ 确定 + 取消 +
+
+
+ + +
+
+
+ +
+
+
二手电脑整机:
+ +
+ + +
+
+
+ +
+
+
屏幕尺寸:
+
+
+ +
+
+ 确定 + 取消 +
+
+
+ + 多选 +
+
+
+
+
+
存储容量:
+
+
+ +
+
+ 确定 + 取消 +
+
+
+ 更多 + 多选 +
+
+
+
+
+
尺寸:
+ +
+ + 多选 +
+
+
+
+
+
高级选项:
+ +
+ + + + + + + + + + + + + + +
+
+
+
+
+
+ + + + +
+ + + +
+
正在加载中,请稍后~~
+
<上一页1234567...下一页>100页  到第确定
+
+
+
+
+
+ +

商品精选

+
+
    +
+
+
+ + +
+
+ +
+ + +
+
+
+
+
+ +
商品精选
+
+
+
+
+ +
+
+
+
+ +
+
+
    +
  1. + 品类齐全,轻松购物 +
  2. +
  3. + 多仓直发,极速配送 +
  4. +
  5. + 正品行货,精致服务 +
  6. +
  7. + 天天低价,畅选无忧 +
  8. +
+
+
+
+
+
+
购物指南
+
+ 购物流程 +
+
+ 会员介绍 +
+
+ 生活旅行/团购 +
+
+ 常见问题 +
+
+ 大家电 +
+
+ 联系客服 +
+
+
+
配送方式
+
+ 上门自提 +
+
+ 211限时达 +
+
+ 配送服务查询 +
+
+ 配送费收取标准 +
+
+ 海外配送 +
+
+
+
支付方式
+
+ 货到付款 +
+
+ 在线支付 +
+
+ 分期付款 +
+
+ 公司转账 +
+
+
+
售后服务
+
+ 售后政策 +
+
+ 价格保护 +
+
+ 退款说明 +
+
+ 返修/退换货 +
+
+ 取消订单 +
+
+
+
特色服务
+
+ 夺宝岛 +
+
+ DIY装机 +
+
+ 延保服务 +
+
+ 京东E卡 +
+
+ 京东通信 +
+
+ 京鱼座智能 +
+
+ +
+
+
+
+ + +

京东会员

京东会员 0
成功加入购物车!
购物车
成功加入购物车!
我的消息 0
成功加入购物车!
+ + + + + + \ No newline at end of file -- Gitee