首页
学习
活动
专区
工具
TVP
发布

me的随笔

专栏作者
98
文章
143876
阅读量
15
订阅数
Python实现一个简单的栈结构
雪飞鸿
2023-07-09
960
Python删除注册表键及其子项
Python中可以使用winreg模块中的DeleteKey方法来删除注册表中的键,但该方法不能删除包含子键的键。所以,在删除某个键时要先删除它的所有子键,这里借助栈结构通过循环迭代的方式来获取注册表键的所有子键及子键的子键。完整代码如下:
雪飞鸿
2023-07-09
2470
Python日志和配置库
日志和配置是应用不可缺少的部分,本文用于介绍dynaconf和loguru的简要用法。
雪飞鸿
2023-07-09
3350
Python中的可变对象与不可变对象
+=操作符对应__iadd__魔法方法,对于不可变对象,a+=b和a=a+b等价,对于可变对象并不等价,dict和set不支持+=和+操作符。
雪飞鸿
2023-04-19
7660
ASP.NET Core解析Protobuf格式数据
ASP.NET Core通过IInputFormatter来解析输入的数据,并进行模型绑定(Model Binding);通过IOutputFormatter来解析输出的数据,来格式化响应(format response)。
雪飞鸿
2022-09-20
1.1K0
Python装饰器
Python中的装饰器是一个用于修改类或者函数功能的可调用对象(callable),函数或者实现了__call__方法的类都可以看作是可调用对象。Python中装饰器分为两大类:
雪飞鸿
2022-01-06
4840
异步与协程
前段时间有同事问了一个问题:JavaScript是单线程运行代码,那么如下代码片段中,同样是执行func1和func2,为什么只用 Promise.all 相比于直接执行 await func1();await func2(); 速度更快:
雪飞鸿
2021-07-20
1.1K0
Python实现单链表和字典
本文记录使用Python练习实现单链表和字典的代码 目录结构: . |-- demo | |-- main.py | |-- src | | |-- my_dict.py | | |-- my_linked_list.py 单链表: # _*_coding: utf-8 _*_ # https://zhuanlan.zhihu.com/p/60057180 class LinkedListNode(): """链表节点""" def __init__(self,
雪飞鸿
2020-10-23
6030
Python 序列化/反序列化自定义类型
内置json模块对于Python内置类型序列化的描述 """Extensible JSON <http://json.org> encoder for Python data structures. Supports the following objects and types by default: +-------------------+---------------+ | Python | JSON | +====
雪飞鸿
2020-09-21
7990
Python import 与 __all__
使用from <module> import *导入模块时,若显式定义了__all__,则只导入__all__中的name,否则会导入除以下划线开头的所有name
雪飞鸿
2020-06-16
1.1K0
[抄录]Unicode & UTF
Fundamentally, computers just deal with numbers. They store letters and other characters by assigning a number for each one. Before the Unicode standard was developed, there were many different systems, called character encodings, for assigning these numbers. These earlier character encodings were limited and did not cover characters for all the world’s languages. Even for a single language like English, no single encoding covered all the letters, punctuation, and technical symbols in common use. Pictographic languages, such as Japanese, were a challenge to support with these earlier encoding standards.
雪飞鸿
2020-02-11
8190
Python中的passed by assignment与.NET中的passing by reference、passing by value
Remember that arguments are passed by assignment in Python. Since assignment just creates references to objects, there’s no alias between an argument name in the caller and callee, and so no call-by-reference per se.
雪飞鸿
2019-11-18
4770
Python中的类、对象、继承
上述访问级别更多的是一种编程约定,即便是以双下划线开头的字段,在类的外部也是可以访问的,但不建议这么做。示例代码如下:
雪飞鸿
2018-09-05
2.2K0
Python知识梳理
我们可以使用type()函数类获取对象的类型,Python3中内置数据类型包括:None,int,float,complex,str,list,dict,tuple,set,frozenset,range等,Python2中还有long类型,Python中并没有内置数组类型。
雪飞鸿
2018-09-05
9440
没有更多了
社区活动
腾讯技术创作狂欢月
“码”上创作 21 天,分 10000 元奖品池!
Python精品学习库
代码在线跑,知识轻松学
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
技术创作特训营·精选知识专栏
往期视频·千货材料·成员作品 最新动态
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档