
Python
uefi_artisan
这个作者很懒,什么都没留下…
展开
-
python memoryview
python 中的memoryview 提供了类似C语言指针的功能,有了memoryview ,如果某个object 支持buffer protocol, 那么就可以通过memory去访问到它内部的数据。class memoryview(obj)如果要用memoryview 去引用一个object, 那么这个object 必须支持buffer protocol, python原创 2016-05-19 10:10:20 · 5640 阅读 · 0 评论 -
用python 解析XML 的几种常见方法的介绍
XML (Extensible markup Language) 指的是可扩展标记语言,被设计用来传输和存储数据,已经日趋成为当前许多新技术的核心,在不同的领域都有着不同的应用,它是web 发展到一定阶段的必然产物 python 解析XML 常见的有三种方法一是 xml.dom.* 模块, 它是W3C DOM API 的实现,若需要处理DOM API 则该模块很适合,注意 xml.dom...转载 2018-10-21 23:17:01 · 285 阅读 · 0 评论 -
python list 的初始化
产生一个固定长度的list:比如 长度为5 , 里面内容都是0x55aa的listsample_list = [0x55aa for i in range(10)] sample_list = [0x8]*5原创 2018-08-23 23:15:05 · 5537 阅读 · 0 评论 -
python exception handling
try/except form: the complete form of try/except/else/finally looks like the following:try: Normal execution block except A: Exception A handle except B: Exception B hand...原创 2018-04-11 22:38:48 · 444 阅读 · 0 评论 -
Micropython解释器大致执行流程
最终由mp_execute_bytecode执行bytecode // execute the byte code with the correct globals context code_state->old_globals = mp_globals_get(); mp_globals_set(self->globals); mp_vm_return_kin原创 2016-06-21 16:32:34 · 4805 阅读 · 0 评论 -
pythton 中struct.pack() 和struct.unpack() 用法详细说明
python 中的struct 主要用来处理C结构数据的,读入时先转换为python 的字符串类型,然后再转换成python 的结构化类型,比如元组(tuple), struct.pack() 和struct.unpack()在转化过程中,主要用到了一个格式化字符串(format strings) , 用来规定转化的方法和格式。struct.pack(fmt, v1, v2, ...转载 2019-01-28 11:11:43 · 2204 阅读 · 0 评论