找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 2157|回复: 1

[求助] 出现错误,请帮助。

0

主题

0

帖子

0

积分

贫民

积分
0
木易杨 发表于 2020-1-14 12:33:45 | 显示全部楼层 |阅读模式
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>>
RESTART: C:\Users\Administrator.SC-201905201543\Desktop\vestor\vestor\sis数据获取-py37.py
Traceback (most recent call last):
  File "C:\Users\Administrator.SC-201905201543\Desktop\vestor\vestor\sis数据获取-py37.py", line 15, in <module>
    class TagData(Structure):
NameError: name 'Structure' is not defined
>>>

代码如下 :
# -*- coding: utf-8 -*-

import os
import time
#from ctypes import *
import pymysql

import datetime

DLL_PATH = os.path.dirname(__file__) + '\\'
DLL_FILE = os.path.join(DLL_PATH, 'RTDBInterface.dll')
INI_FILE = os.path.join(DLL_PATH, 'VeStore.ini')


class TagData(Structure):
    _fields_ = [('value', c_double), ('time', c_long), ('status', c_int)]


class ReadHiDataRequest(Structure):
    _fields_ = [('stTime', c_long), ('enTime', c_long), ('tPeriod', c_long), ('reqType', c_int),
                ('pointName', c_char_p)]


回复

使用道具 举报

1

主题

17

帖子

17

积分

贫民

积分
17
1276571113 发表于 2020-1-16 13:41:30 | 显示全部楼层
你好,你这里是缺少了 Structure 这个超类。
若有定义的,则请补全。若没有定义的,则在:
import datetime
这句下面定义这个超类(定义如下),临时处理看是否可行。
class Structure:pass
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表