摘要: 1.socket服务端,curl访问 #!/usr/bin/env python3 # coding:utf-8 import socket def handle_request(client): recv = client.recv(1024) client.send(bytes("HTTP/1. 阅读全文
posted @ 2024-11-10 00:07 铿锵有力自信且坚定 阅读(114) 评论(0) 推荐(0)
摘要: 1.连接 import pymysql # 创建连接 conn = pymysql.connect(host="127.0.0.1", port=3306, user="root", password="123456",db="test") # 创建游标 cursor = conn.cursor() 阅读全文
posted @ 2024-10-27 16:27 铿锵有力自信且坚定 阅读(54) 评论(0) 推荐(0)
摘要: 1. 创建一个表 create table class(id int not null primary key, name char(16)); # 插入数据 insert into class(id,name) values(1,"张三"); insert into class(id,name) 阅读全文
posted @ 2024-10-27 15:11 铿锵有力自信且坚定 阅读(69) 评论(0) 推荐(0)
摘要: 1. 创建表 create table info(id int auto_increment, name char(32) not null, age int not null, registerdate date not null, primary key (id)); 解析: auto_incr 阅读全文
posted @ 2024-10-26 16:34 铿锵有力自信且坚定 阅读(75) 评论(0) 推荐(0)
摘要: 1.登录本机数据库 mysql -uroot -p123456 2.查看有几个数据库 show databases; 2.进入某个数据库 use mysql; 3.查看数据库中有几个表 show tables; 4.查看表结构 DESCRIBE table_name; desc db; 5.查看表数 阅读全文
posted @ 2024-10-26 13:37 铿锵有力自信且坚定 阅读(117) 评论(0) 推荐(0)
摘要: SHOW VARIABLES LIKE 'character_set_database';SHOW VARIABLES LIKE 'collation_database';SHOW DATABASES;SELECT DATABASE();SHOW TABLES FROM my_data;SHOW C 阅读全文
posted @ 2024-10-26 00:15 铿锵有力自信且坚定 阅读(69) 评论(0) 推荐(0)
摘要: 1.多进程from multiprocessing import Processimport timedef f(name): time.sleep(2) print("ni hao", name)if __name__ == "__main__": for i in range(10): p = 阅读全文
posted @ 2024-10-23 22:26 铿锵有力自信且坚定 阅读(49) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2024-10-23 21:05 铿锵有力自信且坚定 阅读(1) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2024-10-23 20:59 铿锵有力自信且坚定 阅读(1) 评论(0) 推荐(0)
摘要: 1.简单例子 import threadingimport timedef run(n): print("task", n) time.sleep(2)t1 = threading.Thread(target=run, args=("t1",))t2 = threading.Thread(targe 阅读全文
posted @ 2024-10-21 22:34 铿锵有力自信且坚定 阅读(57) 评论(0) 推荐(0)