当前位置:首页>python>Python变量定义与命名规则——代码的基石

Python变量定义与命名规则——代码的基石

  • 2026-02-24 22:50:32
Python变量定义与命名规则——代码的基石

一、什么是变量?

变量是程序中用来存储数据的“容器”——就像贴了标签的盒子,你可以往里面放东西,也可以随时取出或更换。

# 变量定义:盒子名 = 里面的东西
name = "小明"# name这个盒子里放了"小明"
age = 18# age这个盒子里放了18

变量三要素:

  • • 变量名:盒子的标签
  • • 赋值符号=(不是数学里的等号,而是“把...放进...”)
  • • 变量值:盒子里的内容

二、变量的定义与使用

2.1 基本定义语法

变量名 = 值

案例:

# 字符串变量
name = "Python"
course = "编程入门"

# 数字变量
version = 3.11
year = 1991

# 布尔变量
is_easy = True
is_free = False

# 使用变量
print(name)        # Python
print(version)     # 3.11
print(name + "诞生于" + str(year))  # Python诞生于1991

2.2 变量的特性

特性1:动态类型——变量类型由值决定,随时可改变

# 同一个变量可以赋不同类型
x = 10# 整数
print(type(x))  # <class 'int'>

x = "Hello"# 字符串
print(type(x))  # <class 'str'>

x = True# 布尔值
print(type(x))  # <class 'bool'>

特性2:变量可以重新赋值

score = 80
print(score)  # 80

score = 95# 重新赋值
print(score)  # 95

score = score + 5# 在原值基础上增加
print(score)  # 100

特性3:多个变量可以同时赋值

# 方式1:一行一个
a = 1
b = 2
c = 3

# 方式2:一行多个(元组解包)
a, b, c = 123

# 方式3:相同值
x = y = z = 0

2.3 变量定义实战案例

案例1:个人信息卡

# 定义变量
name = "张三"
age = 25
city = "北京"
job = "Python工程师"
salary = 20000

# 使用变量
print("=" * 30)
print("        个人名片")
print("=" * 30)
print(f"姓名:{name}")
print(f"年龄:{age}岁")
print(f"城市:{city}")
print(f"职业:{job}")
print(f"月薪:{salary}元")
print("=" * 30)

案例2:简单计算器

# 定义变量
a = 15
b = 4

# 各种运算
sum_result = a + b
diff_result = a - b
product_result = a * b
quotient_result = a / b
remainder = a % b

# 输出结果
print(f"{a} + {b} = {sum_result}")
print(f"{a} - {b} = {diff_result}")
print(f"{a} × {b} = {product_result}")
print(f"{a} ÷ {b} = {quotient_result}")
print(f"{a} ÷ {b} 的余数 = {remainder}")

三、命名规则(必须遵守)

3.1 硬性规则(不遵守会报错)

规则1:只能包含字母、数字、下划线

# ✅ 正确
name = "小明"
user_name = "小红"
age2 = 18
_private = "私有变量"

# ❌ 错误
user-name = "张三"# 不能有短横线
name$ = "李四"# 不能有美元符号
2age = 20# 不能以数字开头

规则2:不能以数字开头

# ✅ 正确
user1 = "用户1"
user_2 = "用户2"

# ❌ 错误
1user = "用户1"# SyntaxError
123abc = "测试"# SyntaxError

规则3:不能是Python关键字

# Python关键字列表(共35个)
# False, True, None, and, or, not, if, else, elif
# for, while, break, continue, return, def, class
# import, from, as, try, except, finally, with
# is, in, lambda, global, nonlocal, pass, assert
# raise, yield, del, await, async

# ✅ 正确
class_name = "Python班"# 加下划线避免冲突
if_condition = True# 加下划线

# ❌ 错误
class = "Python班"# class是关键字
if = True# if是关键字
return = 10# return是关键字

规则4:区分大小写

# 以下三个是完全不同的变量
name = "小明"
Name = "小红"
NAME = "小刚"

print(name)  # 小明
print(Name)  # 小红
print(NAME)  # 小刚

3.2 命名规范(建议遵守)

规范1:见名知意

# ❌ 不好的命名
a = "张三"
b = 25
c = "北京"

# ✅ 好的命名
name = "张三"
age = 25
city = "北京"

规范2:使用下划线分隔单词(蛇形命名法)

# Python官方推荐:小写字母 + 下划线
user_name = "admin"
first_name = "张"
last_name = "三"
is_logged_in = True
total_price = 199.99

规范3:常量用全大写

# 常量:程序中不该改变的值
PI = 3.14159
MAX_SIZE = 100
DEFAULT_COLOR = "black"
TAX_RATE = 0.13

规范4:类名用驼峰命名

# 类名:首字母大写(大驼峰)
classStudentInfo:
pass

classCarModel:
pass

四、变量命名实战对照

4.1 学生信息场景

# ❌ 糟糕的命名
s1 = "张三"
s2 = 18
s3 = 90.5
s4 = True

# ✅ 优秀的命名
student_name = "张三"
student_age = 18
student_score = 90.5
is_passed = True

# 或者用前缀分组
stu_name = "张三"
stu_age = 18
stu_score = 90.5
stu_pass = True

4.2 电商场景

# ❌ 糟糕的命名
p = "笔记本电脑"
q = 2
u = 5999.00
d = 0.1

# ✅ 优秀的命名
product_name = "笔记本电脑"
quantity = 2
unit_price = 5999.00
discount_rate = 0.1

# 计算总价
total_price = quantity * unit_price * (1 - discount_rate)
print(f"商品:{product_name},数量:{quantity},总价:{total_price}元")

4.3 游戏场景

# ❌ 糟糕的命名
x = 100
y = 200
h = 100
s = 5

# ✅ 优秀的命名
player_x = 100
player_y = 200
player_health = 100
player_speed = 5

enemy_x = 300
enemy_y = 150
enemy_health = 80

五、变量的数据类型

5.1 基本数据类型

类型
名称
示例
说明
int
整数
age = 18
没有小数点的数字
float
浮点数
price = 19.99
带小数点的数字
str
字符串
name = "Python"
文本,必须加引号
bool
布尔值
is_ok = True
只有True/False
NoneType
空值
data = None
表示“什么都没有”

5.2 查看变量类型

# type()函数查看类型
name = "Python"
version = 3.11
year = 1991
is_popular = True

print(type(name))     # <class 'str'>
print(type(version))  # <class 'float'>
print(type(year))     # <class 'int'>
print(type(is_popular))  # <class 'bool'>

# 类型转换
age_str = "25"
age_int = int(age_str)     # 字符串转整数
price_float = float("19.99")  # 字符串转浮点数
age_str_again = str(25)    # 整数转字符串

六、常见错误与解决方法

错误1:使用未定义的变量

# ❌ 错误
print(age)  # NameError: name 'age' is not defined

# ✅ 正确
age = 18
print(age)

错误2:拼写不一致

# ❌ 错误
user_name = "小明"
print(usr_name)  # NameError(拼写错误)

# ✅ 正确
user_name = "小明"
print(user_name)  # 保持一致

错误3:混淆=和==

# = 是赋值,== 是等于比较
# ❌ 错误
if score = 100:  # 这里应该是==
print("满分")

# ✅ 正确
if score == 100:
print("满分")

错误4:中文变量名(不推荐)

# Python3支持中文变量名,但强烈不推荐
姓名 = "张三"# 虽然能运行,但不要这样写
年龄 = 25# 与国际惯例不符,合作困难

# ✅ 正确做法
name = "张三"
age = 25

七、变量命名最佳实践总结

7.1 好变量名的特征

✅ 描述性强total_price 优于 tp
✅ 长度适中user_age 优于 u_a 也优于 this_is_the_age_of_the_current_user
✅ 符合习惯:遵循团队或社区的命名规范
✅ 一致性:全项目用同一种命名风格

7.2 变量命名速查表

场景
推荐命名
不推荐
用户姓名
user_name
full_name
name
(太笼统)
年龄
age
user_age
a
是否激活
is_active
is_enabled
active
(容易误解)
总数
total_count
total
count
(不够明确)
价格
unit_price
total_price
p
pr
日期
create_date
start_time
date
(什么日期?)
列表
user_list
names
list
(覆盖关键字)

7.3 三字口诀

见名知意是第一
下划线分单词好
常量全用大写标
关键字名要避开
大小写意要分清
命名规范终身用

八、练习与验证

练习1:找出错误命名

# 以下哪些变量名是错的?为什么?
1. user-name = "张三"
2. _private = "私有"
3. 2nd_place = "亚军"
4.class = "Python"
5. user_name = "李四"
6.if = True
7. max_value = 100
8.import = "模块"

答案: 1(有横线)、3(数字开头)、4(class关键字)、6(if关键字)、8(import关键字)


练习2:改进命名

# 把下面的变量名改得更好
a = "苹果"# 改为:product_name
b = 5# 改为:quantity
c = 8.5# 改为:unit_price
d = True# 改为:in_stock
e = a + ":" + str(b)  # 保持逻辑

练习3:完整案例优化

# 原代码(命名糟糕)
n = "张三"
a = 25
s = 185.5
w = 75.5
h = "游泳"
m = "13800138000"

# 优化后
name = "张三"
age = 25
height = 185.5
weight = 75.5
hobby = "游泳"
mobile = "13800138000"

print(f"姓名:{name}")
print(f"年龄:{age}岁")
print(f"身高:{height}cm")
print(f"体重:{weight}kg")
print(f"爱好:{hobby}")
print(f"手机:{mobile}")

写在最后

变量是编程的基石,好的变量名是写好代码的第一步

  • • 机器只看语法是否正确
  • • 人要看名字是否清晰

养成习惯: 写变量名前先想3秒——“这个名字别人能看懂吗?一周后的自己能看懂吗?”

记住: 代码是写给机器运行的,但更是写给看的。

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-28 23:30:22 HTTP/2.0 GET : https://f.mffb.com.cn/a/476051.html
  2. 运行时间 : 0.187093s [ 吞吐率:5.34req/s ] 内存消耗:4,762.62kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=c7d7de520f25c94842a1eccc52cbbf0e
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.001025s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001422s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000750s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000692s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001353s ]
  6. SELECT * FROM `set` [ RunTime:0.000619s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001506s ]
  8. SELECT * FROM `article` WHERE `id` = 476051 LIMIT 1 [ RunTime:0.001154s ]
  9. UPDATE `article` SET `lasttime` = 1772292622 WHERE `id` = 476051 [ RunTime:0.001273s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000572s ]
  11. SELECT * FROM `article` WHERE `id` < 476051 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001377s ]
  12. SELECT * FROM `article` WHERE `id` > 476051 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.001023s ]
  13. SELECT * FROM `article` WHERE `id` < 476051 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.002975s ]
  14. SELECT * FROM `article` WHERE `id` < 476051 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002007s ]
  15. SELECT * FROM `article` WHERE `id` < 476051 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.002138s ]
0.190882s