摘要:
def example_func(**kwargs): for key, value in kwargs.items(): print(f"{key}: {value}") example_func(name="Alice", age=25, city="New York") 阅读全文
posted @ 2023-08-14 16:33
胖豆芽
阅读(11)
评论(0)
推荐(0)
摘要:
# 导入正则表达式 import re # 参数2 str1 = "<html>a='as1d32as1d654as54d65asd465asd4'</html>" # 参数1 pattern = r"<html>a=(.*?)</html>" # 调用re中的寻找方法search result = 阅读全文
posted @ 2023-08-14 16:31
胖豆芽
阅读(13)
评论(0)
推荐(0)
摘要:
with open("file.txt", "r") as file: lines = file.readlines() print(lines) # ['Line 1\n', 'Line 2\n', 'Line 3\n'] with open("file.txt", "r") as file: c 阅读全文
posted @ 2023-08-14 15:55
胖豆芽
阅读(70)
评论(0)
推荐(0)
摘要:
alist1=["apple","banana","orange"] alist2=["pear","peach","watermelon"] alist1.append(alist2) print(alist1) ''' ['apple', 'banana', 'orange', ['pear', 阅读全文
posted @ 2023-08-14 15:46
胖豆芽
阅读(75)
评论(0)
推荐(0)
摘要:
str1 = 'agcadssadjkl' one=str1.index('a',) t=str1.index('a',one+1) s=str1.index('a',t+1) print(one) print(t) print(s) ''' 037 ''' 阅读全文
posted @ 2023-08-14 15:30
胖豆芽
阅读(44)
评论(0)
推荐(0)
摘要:
import inspect def func1(): caller = inspect.stack()[1].function ''' stack 堆栈;[0] 是自己所在的方法; [1]是被调用的方法 ''' print(f"func1方法被{caller}方法调用了") def func2() 阅读全文
posted @ 2023-08-14 14:44
胖豆芽
阅读(17)
评论(0)
推荐(0)
摘要:
项目工程格式如下 1.写一个flask功能 app/app.py from flask import Flask app = Flask(__name__) @app.route("/index") def index(): return "Hello World!" if __name__ == 阅读全文
posted @ 2023-08-11 20:20
胖豆芽
阅读(187)
评论(0)
推荐(0)
摘要:
1. 新建一个flask工程文件 2. 将工程文件,打包成一个txt 文件 pip freeze >req.txt 未完待续 阅读全文
posted @ 2023-08-10 17:32
胖豆芽
阅读(15)
评论(0)
推荐(0)
摘要:
去掉了注册signup.html页,因为是最简单的一个工程,不验证账号的唯一性 /**创建flask数据库**/ CREATE DATABASE flask CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; /**创建用户表**/ CREATE TA 阅读全文
posted @ 2023-08-09 18:08
胖豆芽
阅读(69)
评论(0)
推荐(0)
摘要:
# configs/configs.ini [servers] DEV = http://ip:port #libs/login_sig.pyimport requests import hashlib import configparser def get_host(): conf_info=co 阅读全文
posted @ 2023-08-08 22:20
胖豆芽
阅读(135)
评论(0)
推荐(0)
浙公网安备 33010602011771号