python - python ctypes OSError:异常:访问冲突读取0x008B1000
问题描述
错误
Traceback (most recent call last):
File "c:/Users/Administrator/Source/Repos/RSPluginKey/Debug/load.py", line 9, in <module>
work.re("")#http been del
OSError: exception: access violation reading 0x008B1000
蟒蛇代码
from ctypes import *
import os
sdir = os.path.dirname(__file__)
work = CDLL(sdir + "\\RSPluginKey.dll")
print(work)
work.re("http://127.0.0.1")
cpp代码
#include "pch.h"
#include <iostream>
#include <string>
#include "requests.h"
extern "C" {//以此格式来添加引用函数
__declspec(dllexport) void re(std::string http);
}
void re(std::string http) {
using namespace std;
using namespace requests;
Response resp = Get(http);
cout << resp.status << endl;
cout << resp.GetText() << endl;
}
请求:https ://github.com/lxwAsm/requests
也许是请求或其他事情,我是 ctypes 的新用户,需要帮助!
怎么办?请
解决方案
推荐阅读
- java - 我正在尝试在 Java 中执行一个在 Dotnet 中开发的 exe
- android - ScrollView SmoothScrollBy 不显示最后一项
- amazon-web-services - Amazon SNS:创建 AWS Lambda API 网关,如何确认订阅
- php - 带有 firebird 和 php 的 Web 服务
- laravel - Laravel:更改数据库中时间戳的名称
- c++ - 是shared_future
条件变量的合法替代品? - python - Numpy 全局保持维度
- javascript - 什么是“PropTypes.oneOf”的 TypeScript 等效项(将变量限制为值的子集)
- google-cloud-platform - 如何让 glusterfs 在集群升级中存活下来
- angular - Datepicker (matCalendar) angular2 应该在滚动页面时移动