原创 python property(不動產)方法

1 class Test(object): 2 @property 3 def test(self): 4 return 100 5 6 @test.setter 7

原创 利用python裝飾器爲字符串添加,HTML標籤

# 爲字符串添加HTML標籤 import time def zhuang(fun): def zhaung_1(*args, **kargs): # time.sleep(1) html

原创 python,裝飾器帶參數,原理

1 import time 2 3 # 函數裝飾器傳參 4 def zhuang1(hao): 5 def zhuang2(func1): 6 def funczhuang(*args,

原创 sql查詢 ——排序

1 -- 排序 2 -- order by 排序 默認爲升序 3 -- asc 升序 4 -- desc 降序 5 -- 查詢身高 分別用升序和降序 6

原创 sql查詢 —— 分頁

-- 分頁 -- limit -- limit start count (start 顯示騎士值,單頁數量) select *from student where gender=1 limi

原创 sql查詢 —— 連接查詢

1 -- 執行sql文件 test.sql 2 -- 打開終端 3 -- cd sql文件所在路徑 4 -- 進入mysql 5 -- use 數據庫 6 -- 執行 7 source t

原创 mysql 查詢——邏輯查詢

1 --去重查詢 distinct 2 select distinct gander from student; 3 4 --邏輯查詢 5 and or not 6 --查詢18-28之間的數據 7

原创 sql查詢 ——聚合函數

1 --聚合函數 2 -- sum() 3 -- 求和 4 select sum(age) from student; 5 6 -- count() 7

原创 sql查詢——範圍查詢(區間查詢)

1 --範圍查詢(區間查詢) 2 --in() 3 --查詢年齡爲18,28,38的人 select *from student where age=18 or age=28 or age=38; 4 sel

原创 python pymysql 基本使用

1 from pymysql import * 2 3 # 1.創建連接數據庫 4 conn = connect(host="localhost", port=3306, user="root", password="ro

原创 sql查詢 —— 模糊查詢

1 --模糊查詢 2 --like 3 --%至少替換一個 4 -- _只替換一個 5 -- 查姓李的人 6 select *from student name like "李%"; 7

原创 sql查詢 —— 分組

1 -- 分組 2 -- group by 3 -- 分組只有與聚合函數一起使用才能發揮作用 4 -- 分組只限於字段分明 例如 性別 ,部門, 5 --列出所有性別

原创 sql查詢——子查詢

1 -- 子查詢 2 -- 一句查詢語句內,再套一句查詢語句 ,叫子查詢 3 -- 查詢班級類身高最高的人的名字 4 select name from students where high=(s

原创 socket 簡單實現HTTP服務器

1 # -*- coding: utf-8 -*- 2 # @Time : 2019-07-17 1:39 3 # @File : 網絡socket實現http服務器.py 4 # @Software: PyCharm

原创 python3 yield實現假的多併發

import timedef fun1(): while True: print("fun1") time.sleep(0.1) yielddef fun2(): while Tru