Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 巨蟒;名称错误:名称';c#u bool';“未定义”;_Python - Fatal编程技术网

Python 巨蟒;名称错误:名称';c#u bool';“未定义”;

Python 巨蟒;名称错误:名称';c#u bool';“未定义”;,python,Python,我正在尝试使用python库Mosquito为maemo编写程序。我使用的是libmosquitto包,它提供了一个mosquitto.py库文件() 程序使用以下代码行导入MOSQUITO: import mosquitto 该程序在我的桌面上运行正常,但在设备上失败,错误如下: NameError: name 'c_bool' is not defined 我正在设备上使用python2.5。我做错了什么?c\u bool在python 2.5中没有定义。它在2.6中是新的: 也许你可

我正在尝试使用python库Mosquito为maemo编写程序。我使用的是libmosquitto包,它提供了一个mosquitto.py库文件()

程序使用以下代码行导入MOSQUITO:

import mosquitto
该程序在我的桌面上运行正常,但在设备上失败,错误如下:

NameError: name 'c_bool' is not defined

我正在设备上使用python2.5。我做错了什么?

c\u bool
在python 2.5中没有定义。它在2.6中是新的:

也许你可以通过添加

c_bool = c_int
在那行后面

from ctypes import *

mosquitto.py
中。虽然看起来很粗略…

这为我解决了问题。我尝试订阅一个MQTT服务器,它按预期工作。谢谢你的帮助!