摘要: class TestInstance: def __init__(self): # 初始化库字典,存放找到的库 self.lib = Proxy() # 使用一个代理对象来模拟层级结构 class Proxy: def __init__(self): self._libObjectDictCache 阅读全文
posted @ 2024-04-27 20:47 朵朵奇fa 阅读(2) 评论(0) 推荐(0) 编辑
摘要: def list_submodules(self,package_path): """递归地列出给定包路径下的所有子模块""" all_submodules = [] # 遍历包路径下的所有文件/目录 for importer, modname, ispkg in pkgutil.iter_modu 阅读全文
posted @ 2024-03-10 20:27 朵朵奇fa 阅读(19) 评论(0) 推荐(0) 编辑
摘要: import importlib.util def import_module_by_path(module_path,module_name): """ 根据给定的完整路径动态导入模块 """ spec = importlib.util.spec_from_file_location(module 阅读全文
posted @ 2024-03-10 20:26 朵朵奇fa 阅读(51) 评论(0) 推荐(0) 编辑
摘要: # testInstance.py # 导入需要的模块 import importlib # 导入模块以动态加载库中的类和函数 import sys # 导入系统模块,用于操作Python解释器的参数和变量 # 定义TestInstance类 class TestInstance: # 初始化方法, 阅读全文
posted @ 2024-03-03 22:06 朵朵奇fa 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 力扣(LeetCode)官网 - 全球极客挚爱的技术成长平台 /** * Note: The returned array must be malloced, assume caller calls free(). */ int cmp(const void * a, const void * b) 阅读全文
posted @ 2023-09-26 17:36 朵朵奇fa 阅读(6) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main () { char* s = "hello"; // 字符串名字就是首地址 printf("%x\n",s); // s是char指针,size = 4 or 8 printf("sizeof s is %d\n", sizeof(s)); / 阅读全文
posted @ 2023-09-26 17:02 朵朵奇fa 阅读(9) 评论(0) 推荐(0) 编辑
摘要: 167. 两数之和 II - 输入有序数组 - 力扣(LeetCode) /** * Note: The returned array must be malloced, assume caller calls free(). */ int* twoSum(int* numbers, int num 阅读全文
posted @ 2023-09-26 14:51 朵朵奇fa 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 力扣(LeetCode)官网 - 全球极客挚爱的技术成长平台 /** * Note: The returned array must be malloced, assume caller calls free(). */ int* intersection(int* nums1, int nums1 阅读全文
posted @ 2023-09-25 16:23 朵朵奇fa 阅读(41) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include<stdio.h> int main() { int nums[] = { 1,1,2,2,3,4,5,6,6 }; int size = sizeof(nums) / sizeof(nums[0]); // 创建一个全0的空数组 int* c 阅读全文
posted @ 2023-09-25 14:48 朵朵奇fa 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 26. 删除有序数组中的重复项 - 力扣(LeetCode) int checkIn(int* nums, int numsSize, int target) { for (int i = 0; i < numsSize; i++) { if (nums[i] == target) { return 阅读全文
posted @ 2023-09-25 10:53 朵朵奇fa 阅读(12) 评论(0) 推荐(0) 编辑