当前位置:首页>python>Python 列表和字典40个进阶用法,效率翻倍

Python 列表和字典40个进阶用法,效率翻倍

  • 2026-06-28 13:54:39
Python 列表和字典40个进阶用法,效率翻倍

列表和字典是 Python 里用得最多的两种数据结构,但真正用熟的人不多。下面这 40 个技巧,从切片到深层合并,挑你用得上的记就行。

往期阅读>>>

Python 20 个文本分析的库:效率提升 10 倍的秘密武器

Python 金融定价利器FinancePy库深度解析

Python 适合新手的量化分析框架AKQuant解析
Python 25个数据清洗技巧:让你的数据质量提升10倍

Python 为什么会成为AI时代的头部语言

Python 40个常用的列表推导式

Python 50个提高代码开发效率的方法

Python 自动检测服务HTTPS证书过期时间并发送预警

Python 自动化操作Redis的15个实用脚本

Python 自动化管理Jenkins的15个实用脚本,提升效率

Python copyparty搭建轻量的文件服务器的方法

Python 实现2FA认证的方法,提升安全性

Python 封装20个常用API接口,提升开发效率

App2Docker:如何无需编写Dockerfile也可以创建容器镜像

Python 集成 Nacos 配置中心的方法

Python 35个JSON数据处理方法

Python 字典与列表的20个核心技巧

Python 15个文本分析的库,提升效率

Python 15个Pandas技巧,提升数据分析效率

Python 运维中30个常用的库,提升效率

Python调用远程接口的方法

Python 提取HTML文本的方法,提升效率

Python 应用容器化方法:实现“一次部署,处处运行”

Python 自动化识别Nginx配置并导出为excel文件,提升Nginx管理效率

Python 5个常见的异步任务处理框架

Python数据科学常见的30个库

Python 50个实用代码片段,优雅高效


一、基础高效操作

1. 链式比较

# 传统写法ifx>5andx<10:print("在范围内")# 链式比较if5<x<10:print("在范围内")

2. 列表推导式的高级应用

# 带条件判断的列表推导式numbers = [12345678910]even_squares = [x**2forxinnumbersifx%2 == 0]print(even_squares)  # [4, 16, 36, 64, 100]# 嵌套列表推导式matrix = [[123], [456], [789]]flattened = [numforrowinmatrixfornuminrow]print(flattened)  # [1, 2, 3, 4, 5, 6, 7, 8, 9]

3. 列表切片技巧

# 反转列表my_list = [12345]reversed_list = my_list[::-1]print(reversed_list)  # [5, 4, 3, 2, 1]# 获取最后n个元素last_three = my_list[-3:]print(last_three)  # [3, 4, 5]# 间隔取元素every_other = my_list[::2]print(every_other)  # [1, 3, 5]

4. 列表合并与展开

# 使用*操作符合并列表list1 = [123]list2 = [456]merged = [*list1*list2]print(merged)  # [1, 2, 3, 4, 5, 6]# 嵌套列表展开nested = [[12], [34], [56]]flattened = sum(nested, [])print(flattened)  # [1, 2, 3, 4, 5, 6]

5. 字典推导式

# 创建平方字典numbers = [12345]square_dict = {xx**2forxinnumbers}print(square_dict)  # {1: 1, 2: 4, 3: 9, 4: 16, 5: 25}# 带条件过滤even_squares = {xx**2forxinnumbersifx%2 == 0}print(even_squares)  # {2: 4, 4: 16}

6. 字典合并

# Python 3.9+ 使用 | 操作符dict1 = {'a'1'b'2}dict2 = {'c'3'd'4}merged = dict1|dict2print(merged)  # {'a': 1, 'b': 2, 'c': 3, 'd': 4}# 传统合并方法merged = {**dict1**dict2}

7. 默认值处理

fromcollectionsimportdefaultdict# 使用defaultdictword_count = defaultdict(int)words = ['apple''banana''apple''orange''banana''apple']forwordinwords:word_count[word] += 1print(dict(word_count))  # {'apple': 3, 'banana': 2, 'orange': 1}

8. 字典键值反转

original = {'a'1'b'2'c'3}reversed_dict = {vkforkvinoriginal.items()}print(reversed_dict)  # {1: 'a', 2: 'b', 3: 'c'}

二、列表与字典组合应用

9. 列表元素分组

fromitertoolsimportgroupbydata = [    {'name''Alice''age'25},    {'name''Bob''age'30},    {'name''Charlie''age'25},    {'name''David''age'30}]# 按年龄分组data.sort(key=lambdaxx['age'])grouped = {klist(vforkvingroupby(datakey=lambdaxx['age'])}print(grouped)# {25: [{'name': 'Alice', 'age': 25}, {'name': 'Charlie', 'age': 25}],#  30: [{'name': 'Bob', 'age': 30}, {'name': 'David', 'age': 30}]}

10. 统计列表元素频率

fromcollectionsimportCounteritems = ['apple''banana''apple''orange''banana''apple']frequency = Counter(items)print(frequency)  # Counter({'apple': 3, 'banana': 2, 'orange': 1})print(frequency.most_common(2))  # [('apple', 3), ('banana', 2)]

三、性能优化技巧

11. 使用生成器表达式

# 列表推导式(占用内存)large_list = [x**2forxinrange(1000000)]# 生成器表达式(节省内存)large_gen = (x**2forxinrange(1000000))# 使用时forvalueinlarge_gen:# 处理每个值pass

12. 使用enumerate获取索引

fruits = ['apple''banana''orange']# 传统写法foriinrange(len(fruits)):print(f"{i}: {fruits[i]}")# 更Pythonic的写法forifruitinenumerate(fruits):print(f"{i}: {fruit}")# 指定起始索引forifruitinenumerate(fruitsstart=1):print(f"{i}: {fruit}")

13. 使用zip同时遍历多个列表

names = ['Alice''Bob''Charlie']ages = [253035]cities = ['New York''London''Paris']fornameagecityinzip(namesagescities):print(f"{name} is {age} years old and lives in {city}")

四、实用算法实现

14. 二分搜索实现

defbinary_search(arrtarget):leftright = 0len(arr-1whileleft<right:mid = (left+right//2ifarr[mid] == target:returnmidelifarr[mid<target:left = mid+1else:right = mid-1return-1# 使用sorted_list = [135791113]result = binary_search(sorted_list7)print(f"找到元素,索引为: {result}")  # 3

15. 斐波那契序列生成器

deffibonacci_generator(n):ab = 01count = 0whilecount<n:yieldaab = ba+bcount += 1# 使用fib_nums = list(fibonacci_generator(10))print(fib_nums)  # [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]

五、数据处理技巧

16. 列表去重保持顺序

defremove_duplicates_preserve_order(items):seen = set()result = []foriteminitems:ifitemnotinseen:seen.add(item)result.append(item)returnresult# 使用duplicate_list = [31214352]unique_list = remove_duplicates_preserve_order(duplicate_list)print(unique_list)  # [3, 1, 2, 4, 5]

17. 字典按值排序

scores = {'Alice'85'Bob'92'Charlie'78'David'95}# 按值升序排序sorted_by_value = dict(sorted(scores.items(), key=lambdaxx[1]))print(sorted_by_value)  # {'Charlie': 78, 'Alice': 85, 'Bob': 92, 'David': 95}# 按值降序排序sorted_desc = dict(sorted(scores.items(), key=lambdaxx[1], reverse=True))print(sorted_desc)# {'David': 95, 'Bob': 92, 'Alice': 85, 'Charlie': 78}

六、函数式编程应用

18. 使用map和filter

numbers = [12345678910]# 使用map进行转换squares = list(map(lambdaxx**2numbers))print(squares)  # [1, 4, 9, 16, 25, 36, 49, 64, 81, 100]# 使用filter进行过滤evens = list(filter(lambdaxx%2 == 0numbers))print(evens)  # [2, 4, 6, 8, 10]# 组合使用even_squares = list(map(lambdaxx**2filter(lambdaxx%2 == 0numbers)))print(even_squares)  # [4, 16, 36, 64, 100]

19. 使用reduce进行累积计算

fromfunctoolsimportreducenumbers = [12345]# 计算乘积product = reduce(lambdaxyx*ynumbers)print(f"乘积: {product}")  # 120# 计算最大值max_value = reduce(lambdaxyxifx>yelseynumbers)print(f"最大值: {max_value}")  # 5

七、错误处理与边界情况

20. 安全获取字典值

user_data = {'name''Alice''age'25}# 安全获取不存在的键email = user_data.get('email''未提供')print(f"邮箱: {email}")  # 邮箱: 未提供# 使用setdefault设置默认值user_data.setdefault('country''中国')print(user_data)  # {'name': 'Alice', 'age': 25, 'country': '中国'}

八、高级数据处理

21. 使用any和all进行条件判断

numbers = [13579]has_even = any(x%2 == 0forxinnumbers)print(f"是否有偶数: {has_even}")  # Falseall_positive = all(x>0forxinnumbers)print(f"是否都为正数: {all_positive}")  # True

22. 列表元素旋转

defrotate_list(lstk):"""将列表元素向右旋转k个位置"""k = k%len(lst)  # 处理k大于列表长度的情况returnlst[-k:] +lst[:-k]my_list = [12345]rotated = rotate_list(my_list2)print(f"旋转后: {rotated}")  # [4, 5, 1, 2, 3]

23. 字典键值交换(处理重复值)

defswap_dict_with_duplicates(original):"""处理有重复值的字典键值交换"""result = {}forkeyvalueinoriginal.items():ifvaluenotinresult:result[value] = [key]else:result[value].append(key)returnresultoriginal = {'a'1'b'2'c'1'd'3}swapped = swap_dict_with_duplicates(original)print(swapped)  # {1: ['a', 'c'], 2: ['b'], 3: ['d']}

24. 列表分块处理

defchunk_list(lstchunk_size):"""将列表分成指定大小的块"""return [lst[i:i+chunk_sizeforiinrange(0len(lst), chunk_size)]numbers = list(range(111))chunks = chunk_list(numbers3)print(f"分块结果: {chunks}")  # [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10]]

25. 字典值排序并获取键

defget_keys_sorted_by_value(dictionaryreverse=False):"""根据值排序并返回对应的键"""return [kforkvinsorted(dictionary.items(), key=lambdaxx[1], reverse=reverse)]scores = {'Alice'85'Bob'92'Charlie'78'David'95}sorted_keys = get_keys_sorted_by_value(scoresreverse=True)print(f"按分数降序排列的名字: {sorted_keys}")  # ['David', 'Bob', 'Alice', 'Charlie']

26. 列表元素频率统计(不使用Counter)

deffrequency_count(lst):"""手动实现元素频率统计"""freq = {}foriteminlst:freq[item] = freq.get(item0+1returnfreqitems = ['apple''banana''apple''orange''banana''apple']freq = frequency_count(items)print(f"元素频率: {freq}")  # {'apple': 3, 'banana': 2, 'orange': 1}

27. 字典深度合并

defdeep_merge_dicts(dict1dict2):"""深度合并两个字典,处理嵌套字典"""result = dict1.copy()forkeyvalueindict2.items():ifkeyinresultandisinstance(result[key], dictandisinstance(valuedict):result[key] = deep_merge_dicts(result[key], value)else:result[key] = valuereturnresultdict1 = {'a'1'b': {'x'10'y'20}}dict2 = {'b': {'y'30'z'40}, 'c'3}merged = deep_merge_dicts(dict1dict2)print(merged)  # {'a': 1, 'b': {'x': 10, 'y': 30, 'z': 40}, 'c': 3}

28. 列表元素滑动窗口

defsliding_window(lstwindow_size):"""生成滑动窗口"""foriinrange(len(lst-window_size+1):yieldlst[i:i+window_size]numbers = [123456]windows = list(sliding_window(numbers3))print(f"滑动窗口: {windows}")  # [[1, 2, 3], [2, 3, 4], [3, 4, 5], [4, 5, 6]]

29. 字典键值类型转换

defconvert_dict_types(dictionarykey_type=strvalue_type=int):"""转换字典键值的类型"""return {key_type(k): value_type(vforkvindictionary.items()}original = {'1''10''2''20''3''30'}converted = convert_dict_types(originalkey_type=intvalue_type=int)print(f"转换后: {converted}")  # {1: 10, 2: 20, 3: 30}

30. 列表元素排列组合

fromitertoolsimportpermutationscombinationsitems = ['A''B''C']perms = list(permutations(items2))print(f"排列结果: {perms}")  # [('A', 'B'), ('A', 'C'), ('B', 'A'), ('B', 'C'), ('C', 'A'), ('C', 'B')]combs = list(combinations(items2))print(f"组合结果: {combs}")  # [('A', 'B'), ('A', 'C'), ('B', 'C')]

31. 字典值提取与转换

defextract_and_transform(dictionarykey_listtransform_func=None):"""提取指定键的值并应用转换函数"""result = []forkeyinkey_list:ifkeyindictionary:value = dictionary[key]iftransform_func:value = transform_func(value)result.append(value)returnresultdata = {'name''Alice''age''25''score''95.5'}keys = ['name''age''score']values = extract_and_transform(datakeystransform_func=lambdaxx.upper() ifisinstance(xstrelsex)print(f"提取并转换的值: {values}")  # ['ALICE', '25', '95.5']

32. 列表元素交错合并

definterleave_lists(*lists):"""交错合并多个列表"""result = []max_len = max(len(lstforlstinlists)foriinrange(max_len):forlstinlists:ifi<len(lst):result.append(lst[i])returnresultlist1 = [123]list2 = ['A''B''C']list3 = ['x''y''z']interleaved = interleave_lists(list1list2list3)print(f"交错合并结果: {interleaved}")  # [1, 'A', 'x', 2, 'B', 'y', 3, 'C', 'z']

33. 字典键值对过滤

deffilter_dict_by_condition(dictionarycondition_func):"""根据条件过滤字典键值对"""return {kvforkvindictionary.items() ifcondition_func(kv)}data = {'apple'5'banana'3'orange'8'grape'2}# 过滤值大于3的项filtered = filter_dict_by_condition(datalambdakvv>3)print(f"过滤结果: {filtered}")  # {'apple': 5, 'orange': 8}# 过滤键包含'a'的项filtered_by_key = filter_dict_by_condition(datalambdakv'a'ink)print(f"按键过滤结果: {filtered_by_key}")  # {'apple': 5, 'banana': 3, 'grape': 2}

34. 列表元素运行总和

defrunning_sum(lst):"""计算列表元素的运行总和"""total = 0result = []fornuminlst:total += numresult.append(total)returnresultnumbers = [12345]sums = running_sum(numbers)print(f"运行总和: {sums}")  # [1, 3, 6, 10, 15]

35. 字典键值对批量更新

defbatch_update_dict(originalupdates):"""批量更新字典,支持嵌套键"""result = original.copy()forkey_pathvalueinupdates.items():if'.'inkey_path:# 处理嵌套键keys = key_path.split('.')current = resultforkinkeys[:-1]:current = current.setdefault(k, {})current[keys[-1]] = valueelse:result[key_path] = valuereturnresultuser = {'name''Alice''profile': {'age'25}}updates = {'name''Alice Smith''profile.age'26'profile.city''Beijing'}updated = batch_update_dict(userupdates)print(updated)  # {'name': 'Alice Smith', 'profile': {'age': 26, 'city': 'Beijing'}}

36. 列表元素模式匹配

deffind_pattern(lstpattern):"""在列表中查找特定模式"""pattern_len = len(pattern)matches = []foriinrange(len(lst-pattern_len+1):iflst[i:i+pattern_len] == pattern:matches.append(i)returnmatchessequence = [1231234123]pattern = [123]positions = find_pattern(sequencepattern)print(f"模式出现位置: {positions}")  # [0, 3, 7]

37. 字典值统计摘要

defdict_summary(dictionary):"""生成字典值的统计摘要"""ifnotdictionary:return {}values = list(dictionary.values())numeric_values = [vforvinvaluesifisinstance(v, (intfloat))]summary = {'count'len(dictionary),'keys'list(dictionary.keys()),'value_types': {type(v).__name__forvinvalues}    }ifnumeric_values:summary.update({'min'min(numeric_values),'max'max(numeric_values),'sum'sum(numeric_values),'avg'sum(numeric_values/len(numeric_values)        })returnsummarydata = {'a'10'b'20'c'30'd''text'}summary = dict_summary(data)print(f"字典摘要: {summary}")

38. 列表元素差异分析

deflist_differences(list1list2):"""分析两个列表的差异"""set1set2 = set(list1), set(list2)return {'only_in_list1'list(set1-set2),'only_in_list2'list(set2-set1),'common'list(set1&set2),'union'list(set1|set2)    }list_a = [12345]list_b = [45678]diff = list_differences(list_alist_b)print(f"列表差异分析: {diff}")

39. 字典键路径访问

defget_nested_value(dictionarykey_pathdefault=None):"""通过点分隔的路径访问嵌套字典值"""keys = key_path.split('.')current = dictionaryforkeyinkeys:ifisinstance(currentdictandkeyincurrent:current = current[key]else:returndefaultreturncurrentdata = {'user': {'profile': {'name''Alice','age'25,'address': {'city''Beijing','zip''100000'            }        }    }}name = get_nested_value(data'user.profile.name')city = get_nested_value(data'user.profile.address.city')country = get_nested_value(data'user.profile.address.country''China')print(f"姓名: {name}")    # Aliceprint(f"城市: {city}")    # Beijingprint(f"国家: {country}"# China

40. 列表元素权重随机选择

importrandomdefweighted_random_choice(itemsweights):"""根据权重随机选择列表元素"""iflen(items!len(weights):raiseValueError("Items and weights must have the same length")total = sum(weights)r = random.uniform(0total)cumulative = 0foritemweightinzip(itemsweights):cumulative += weightifr<cumulative:returnitemreturnitems[-1]  # 安全返回fruits = ['apple''banana''orange']weights = [0.50.30.2]# 模拟多次选择choices = [weighted_random_choice(fruitsweightsfor_inrange(1000)]print(f"苹果出现次数: {choices.count('apple')}")print(f"香蕉出现次数: {choices.count('banana')}")print(f"橙子出现次数: {choices.count('orange')}")

40 个技巧不用全背,前 20 个属于高频场景,基本每天都能用到。21-40 更偏工具性,遇到对应问题时翻出来用比硬记更实际。itertoolscollectionsfunctools 这三个标准库模块值得单独花时间读一遍文档,收益很高。

“无他,惟手熟尔”!有需要的用起来!
如果你觉得这篇文章有用,欢迎点赞、转发、收藏、留言、推荐

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-04 02:43:40 HTTP/2.0 GET : https://f.mffb.com.cn/a/486703.html
  2. 运行时间 : 0.102631s [ 吞吐率:9.74req/s ] 内存消耗:5,053.14kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=cfecc1a08cfa288cfb37267a6b04b32b
  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.000554s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000793s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000343s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000301s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000546s ]
  6. SELECT * FROM `set` [ RunTime:0.000257s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000571s ]
  8. SELECT * FROM `article` WHERE `id` = 486703 LIMIT 1 [ RunTime:0.000669s ]
  9. UPDATE `article` SET `lasttime` = 1783104220 WHERE `id` = 486703 [ RunTime:0.020548s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000458s ]
  11. SELECT * FROM `article` WHERE `id` < 486703 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.001545s ]
  12. SELECT * FROM `article` WHERE `id` > 486703 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000897s ]
  13. SELECT * FROM `article` WHERE `id` < 486703 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001022s ]
  14. SELECT * FROM `article` WHERE `id` < 486703 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002627s ]
  15. SELECT * FROM `article` WHERE `id` < 486703 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.000945s ]
0.104206s