
Python
Xeon_CC
/
展开
-
Python包装器用于缓存
包装器转载 2023-01-04 09:25:48 · 253 阅读 · 0 评论 -
python导包报错from xxx import yyy no module named ‘xxx‘
import osimport syssys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))from xxx import yyy原创 2022-04-27 17:13:40 · 860 阅读 · 0 评论 -
python的OGR库获取geometry属性返回None,feature.geometry()
如下代码,如果你去百度谷歌,多数是这么获取geometry属性。实际上一直返回Nonedef create_data_source(gdbFile, **kwargs): gdal.SetConfigOption("GDAL_FILENAME_IS_UTF8", "YES") driver = ogr.GetDriverByName("FileGDB") if os.path.exists(gdbFile): data_source = driver.Open(gd原创 2022-04-19 15:59:42 · 1305 阅读 · 0 评论 -
Python调用C语言,Python传递list列表参数给C语言的函数以处理,返回数组指针给Python
C/C++怎么生成DLL文件?请参照另外一篇文章:https://blog.youkuaiyun.com/Xeon_CC/article/details/122597635Python代码:# -*- coding:utf-8 -*-import ctypesfrom ctypes import *# lib = ctypes.cdll.LoadLibrary('D:\\AllProjects\\py_projects\\radarGP\\QFupdate\\Dll4.dll')lib = CDLL('原创 2022-02-26 14:34:18 · 1942 阅读 · 1 评论 -
Python调用C语言的时候,如何将Python自定义对象作为C语言的指针传参到C语言的函数里面?
如果你暂时还没有把自己写的C++程序封装成DLL文件,可参照https://blog.youkuaiyun.com/Xeon_CC/article/details/122597635直接写代码准备封装为DLL的C++代码#define EXPORT __declspec(dllexport)#include <iostream>#include <cmath>#include "list"using namespace std;typedef struct test_struc原创 2022-02-25 17:02:00 · 581 阅读 · 0 评论