上一页 1 2 3 4 5 6 ··· 12 下一页
摘要: 参考文档: https://numba.pydata.org/numba-doc/latest/user/cfunc.html cfunc 创建 C/C++回调函数 与 jit 相似,有一个不同点是,cfunc 强制传递一个签名,用来确定 C 回调的可见签名。 cfunc 对象暴漏出编译后的 C 回 阅读全文
posted @ 2024-05-12 17:40 一枚码农 阅读(40) 评论(0) 推荐(0)
摘要: 参考文档:https://numba.pydata.org/numba-doc/latest/user/jitclass.html# jitclass 对类进行装饰 import numba as nb import numpy as np from numba.experimental impor 阅读全文
posted @ 2024-05-12 16:51 一枚码农 阅读(151) 评论(0) 推荐(0)
摘要: 参考文档: https://apachecn.github.io/numba-doc-zh/#/docs/17 vectorize装饰器: 允许python函数的标量入参使用 numpy 的 ufuncs。 import numba as nb @nb.vectorize([nb.int32(nb. 阅读全文
posted @ 2024-05-12 12:52 一枚码农 阅读(173) 评论(0) 推荐(0)
摘要: 点击查看代码 # 读取嵌套型和大小可变的二进制结构 from itertools import chain import struct # 多边形数组 polys = [ [(1.0, 2.1), (2.0, 3.2), (3.0, 4.3)], [(1.1, 2.2), (2.1, 3.3), ( 阅读全文
posted @ 2024-04-27 14:26 一枚码农 阅读(16) 评论(0) 推荐(0)
摘要: 点击查看代码 # 读写二进制结构数组 from functools import partial from struct import Struct # Write def write_records(records, format, f): """Write a sequence of tuple 阅读全文
posted @ 2024-04-27 14:25 一枚码农 阅读(23) 评论(0) 推荐(0)
摘要: 点击查看代码 # 对二进制文件做内存映射 # 使用 mmap 模块对文件进行内存有映射操作 import mmap import os.path def memory_map(filename, access=mmap.ACCESS_WRITE): """ :param filename: :par 阅读全文
posted @ 2024-04-27 14:24 一枚码农 阅读(23) 评论(0) 推荐(0)
摘要: linux安装 # 安装命令: apt-get install httpd-tools # 检查是否安装成功 ab -V # ab参数说明 ab -h >>> -n 在测试会话中所执行的请求个数。默认时,仅执行一个请求。 -c 一次产生的请求个数。默认是一次一个。 -t 测试所进行的最大秒数。其内部 阅读全文
posted @ 2024-04-11 18:03 一枚码农 阅读(95) 评论(0) 推荐(0)
摘要: 1.安装 pip install Sphinx 2.使用 2.1文档手册 Sphinx 1.3.1 中文手册 (推荐查看) 教程 https://fengxc.me/基于python注释使用sphinx自动化生成API文档.html 2.2创建工程 新建一个文件夹sphinx_test, 并创建两个 阅读全文
posted @ 2024-01-09 09:45 一枚码农 阅读(153) 评论(0) 推荐(0)
摘要: .pyc 1.单个文件: python -m py_compile file.py 其中的 -m 相当于脚本中的import,这里的-m py_compile 相当于import py_compile 脚本: Code: import py_compile py_compile.compile('p 阅读全文
posted @ 2024-01-02 16:10 一枚码农 阅读(63) 评论(0) 推荐(0)
摘要: 点击查看代码 class BaseNode: """hdf5 file object relational model basic node class Including establishing model relationships and data sets, attribute value 阅读全文
posted @ 2024-01-02 10:05 一枚码农 阅读(8) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 12 下一页