展开
拓展 关闭
订阅号推广码
GitHub
视频
公告栏 关闭

随笔分类 -  后端

1 2 3 4 5 ··· 25 下一页
摘要:一些在下转换网站有时间限制,使用python转换 安装anaconda,安装依赖 C:\Users\dogle>activate env_dev1 (env_dev1) C:\Users\dogle>pip install moviepy WARNING: Ignoring invalid dist 阅读全文
posted @ 2024-11-27 15:08 DogLeftover 阅读(40) 评论(0) 推荐(0)
摘要:官网 安装 # 打开cmd C:\Users\ychen>pip install pyecharts Looking in indexes: https://mirrors.aliyun.com/pypi/simple/ Collecting pyecharts Downloading https: 阅读全文
posted @ 2024-05-06 10:56 DogLeftover 阅读(64) 评论(0) 推荐(0)
摘要:安装依赖库 pip install selenium 打开谷歌浏览器,搜索框输入如下,查看版本 chrome://version 下载驱动 解压后,将驱动放到python安装目录Scripts文件夹下 测试代码 from time import sleep from selenium import 阅读全文
posted @ 2024-04-19 22:28 DogLeftover 阅读(230) 评论(0) 推荐(0)
摘要:基础使用 # 定义函数 def title(): print("123") # 调用函数 title() 参数 def yz(r): print(2 * 3.14 * r) # 调用函数并传值 yz(10) a = int(input("请输入半径:")) yz(a) """多个参数,两个数相加"" 阅读全文
posted @ 2024-03-26 16:51 DogLeftover 阅读(12) 评论(0) 推荐(0)
摘要:读文件 # 一次行读取文件所有内容 f = open("d:/a.txt", mode="r", encoding="utf-8") c = f.read() print(c) f.close() """如果文件太大,可以一行一行的读取""" f = open("d:/a.txt", mode="r 阅读全文
posted @ 2024-03-26 16:49 DogLeftover 阅读(18) 评论(0) 推荐(0)
摘要:概述 用键值对的方式存储数据 基础使用 my_dict = dict() # 创建一个空字典 print(my_dict) # 输出:{} my_dict = dict(a=1, b=2, c=3) # 创建一个包含键值对的字典 print(my_dict) # 输出:{'a': 1, 'b': 2 阅读全文
posted @ 2024-03-26 16:26 DogLeftover 阅读(18) 评论(0) 推荐(0)
摘要:概述 存放不可重复的数据,存放数据是无序的 基础使用 my_set = set() # 创建一个空集合 print(my_set) # 输出:set() my_set = set([1, 2, 2, 3, 3]) # 创建一个包含元素的集合,重复的元素会被自动去重 print(my_set) # 输 阅读全文
posted @ 2024-03-26 16:16 DogLeftover 阅读(19) 评论(0) 推荐(0)
摘要:概述 不可变的列表 基础使用 t = ("a","b",1,3) print(type(t)) b = t[2] # 取值 print(b) print(t[:3]) print(t[::-1]) # 如果元组只有一个值,在最后加上,逗号 t = ("a",) print(type(t)) # 元组 阅读全文
posted @ 2024-03-26 15:26 DogLeftover 阅读(11) 评论(0) 推荐(0)
摘要:概述 一种有序的可变数据类型,用户存储多个元素 基础使用 my_list = list() # 创建一个空列表 print(my_list) # 输出:[] my_list = list([1, 2, 3]) # 创建一个包含元素的列表 print(my_list) # 输出:[1, 2, 3] l 阅读全文
posted @ 2024-03-26 14:17 DogLeftover 阅读(43) 评论(0) 推荐(0)
摘要:基础使用 # 获取字符串中的某一个字符 s[0] s[1] # 字符串的索引从0开始,切片 s[0] 取出第0个位置的字符 s[2:7] 取出第2-6位置的字符 s[2:] 取出第2个字符及其后面的所有字符 s[:2] 取出0-1位置的字符 s[::] 输出所有字符串 s[::-1] 反向输出所有字 阅读全文
posted @ 2024-03-26 13:53 DogLeftover 阅读(34) 评论(0) 推荐(0)
摘要:基本使用 s = "敌军还有三秒到达,全军出击" for c in s: # 从s这个字符串中依次取出每一个字符,存储变量c中 print(c) print(" ") """ 指定循环10次输出1-10 range(n) 范围0 到 n-1 range(m,n) 范围 m 到 n-1 range(m 阅读全文
posted @ 2024-03-26 10:03 DogLeftover 阅读(38) 评论(0) 推荐(0)
摘要:基本使用 """ 循环10次 你好 """ i = 1 # 用来做循环变量 while i <= 20: print("你好") i += 1 # 1,2,3,4,5,6,7,8,9,10,11 print("程序结束") """ 循环10次 你好,并显示循环的次数 """ i = 1 # 用来做循 阅读全文
posted @ 2024-03-26 09:44 DogLeftover 阅读(166) 评论(0) 推荐(0)
摘要:注释 # 1. 单行注释 ''' 2. 多行注释 这些都是注释 ''' """ 3.多行注释 """ 变量 """ 1. 单个变量赋值 a=10 2. 多个变量赋相同的值 a = b = c = 10 3. 多个变量赋不同的值 a, b, c = 10, 20, 30 """ age = 30 pr 阅读全文
posted @ 2024-03-26 09:27 DogLeftover 阅读(16) 评论(0) 推荐(0)
摘要:安装依赖 (C:\ProgramData\Anaconda3) C:\Users\ychen>pip install flask-migrate Looking in indexes: https://mirrors.aliyun.com/pypi/simple/ Collecting flask- 阅读全文
posted @ 2024-03-20 11:04 DogLeftover 阅读(67) 评论(0) 推荐(0)
摘要:创建表 app.py from flask import Flask, render_template from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) HOSTNAME = "127.0.0.1" PORT = 3306 U 阅读全文
posted @ 2024-03-20 09:58 DogLeftover 阅读(14) 评论(0) 推荐(0)
摘要:安装依赖 (C:\ProgramData\Anaconda3) C:\Users\ychen>pip install pymysql Looking in indexes: https://mirrors.aliyun.com/pypi/simple/ Requirement already sat 阅读全文
posted @ 2024-03-20 09:22 DogLeftover 阅读(98) 评论(0) 推荐(0)
摘要:控制语句 templates目录下新建control.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> {% if age>18 %} <di 阅读全文
posted @ 2024-03-19 16:33 DogLeftover 阅读(22) 评论(0) 推荐(0)
摘要:案例1 templates目录下新建filter.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> {{ user.username }}-{ 阅读全文
posted @ 2024-03-19 15:50 DogLeftover 阅读(14) 评论(0) 推荐(0)
摘要:url与视图的映射 指定url 指定url并指定参数类型 指定默认值 模板渲染 在templates目录下新建html,返回html页面 在templates目录下新建html,接收参数 向指定html传入参数 模板访问对象属性 app.py index.html 阅读全文
posted @ 2024-03-19 15:06 DogLeftover 阅读(9) 评论(0) 推荐(0)
摘要:安装依赖 (C:\ProgramData\Anaconda3) C:\Users\ychen>pip install flask==2.0.1 Looking in indexes: https://mirrors.aliyun.com/pypi/simple/ Collecting flask== 阅读全文
posted @ 2024-03-19 14:52 DogLeftover 阅读(59) 评论(0) 推荐(0)

1 2 3 4 5 ··· 25 下一页