随笔分类 -  python

python 模块导入
摘要: 阅读全文
posted @ 2025-08-06 17:31 属于我的梦,明明还在 阅读(6) 评论(0) 推荐(0)
PyInstaller打包Python程序为exe
摘要:安装PyInstaller: pip install pyinstaller 打包程序: 使用PyInstaller将你的Python脚本打包成exe文件。假设你的脚本名为your_script.py,在命令行中运行: pyinstaller --onefile your_script.py 这个命 阅读全文
posted @ 2024-05-09 16:53 属于我的梦,明明还在 阅读(122) 评论(0) 推荐(0)
Python创建虚拟环境Virtualenv
摘要: 阅读全文
posted @ 2024-05-06 13:37 属于我的梦,明明还在 阅读(9) 评论(0) 推荐(0)
python fastapI 开篇--路由分发
摘要:4、示例生成fastapi接口文档 5、路由分发 结果显示 阅读全文
posted @ 2024-04-17 11:24 属于我的梦,明明还在 阅读(58) 评论(0) 推荐(0)
python 连接数据库
摘要:import pymysqlconnection = pymysql.connect(host='192.168.228.56',port=3306, user='root',password='123456', db='account',charset='utf8') #host:主机IP por 阅读全文
posted @ 2022-10-31 17:28 属于我的梦,明明还在 阅读(52) 评论(0) 推荐(0)
pyhton as
摘要:1.with...as...第一种是和with结合使用,主要用于文件的读写操作,省去了关闭文件的麻烦。写法: with open("文件路径","读写方式") as 赋值变量: 执行代码块实例: #test.py with open("1.txt") as f: print f.read() #1. 阅读全文
posted @ 2022-03-07 14:41 属于我的梦,明明还在 阅读(40) 评论(0) 推荐(0)
详解python ConfigParse 模块
摘要:ConfigParse 模块: 阅读全文
posted @ 2022-03-07 14:34 属于我的梦,明明还在 阅读(39) 评论(0) 推荐(0)
详解 python os 模块
摘要:OS 模块: OS模块:获取当前使用的操作系统 1、os.getcwd()函数 功能:获取当前目录,python 的工作目录 import os pwd = os.getcwd() print (pwd) 2、os.name 函数 功能:获取当前使用的操作系统(获取信息不够详细) 其中 'nt' 是 阅读全文
posted @ 2022-03-07 11:21 属于我的梦,明明还在 阅读(354) 评论(0) 推荐(0)
python 初识爬虫
摘要:一、安装requests pip install requests 二、requests库的基础方法如下: F12的使用 阅读全文
posted @ 2022-03-01 14:14 属于我的梦,明明还在 阅读(38) 评论(0) 推荐(0)
python 无法下载requests 模块解决方法
摘要:问题描述: 解决方法: python -m pip install --upgrade pip 更新pip ,后重新下载 结果: 阅读全文
posted @ 2022-03-01 14:11 属于我的梦,明明还在 阅读(639) 评论(0) 推荐(0)
部署python 环境
摘要:一、安装部署 https://www.python.org/downloads/windows/ 官网查找部署包即安装,勾选ADD path 二、部署 pycharm https://www.jetbrains.com/pycharm/download/#section=windows 选择社区版, 阅读全文
posted @ 2022-02-23 13:13 属于我的梦,明明还在 阅读(71) 评论(0) 推荐(0)
python 语法应用
摘要:一、变量赋值 Python 中的变量赋值不需要类型声明。等号 = 用来给变量赋值。 #!/usr/bin/python # -*- coding: UTF-8 -*- counter = 100 # 赋值整型变量 miles = 1000.0 # 浮点型 name = "John" # 字符串 pr 阅读全文
posted @ 2022-02-23 10:20 属于我的梦,明明还在 阅读(54) 评论(0) 推荐(0)