社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Python

使用Python2.7读取微芯片中的罗马字符

Bill • 6 年前 • 814 次点击  

我使用Windows7和Python2.7。

我写了一个GUI程序来读取和显示微芯片上的一些名字,它对所有名字都很有效,除了一些罗马字符,比如‘I’。

这是从微芯片读取名称的功能:

def read_config_info(self, info):
    MAX_LEN = 256
    item_info = c_char_p(info)
    read_value_buffer= create_string_buffer(MAX_LEN)
    max_len = c_uint32(MAX_LEN)
    p_max_len = pointer(max_len)

    status = self._engine_dll.teConfigCacheReadItem(self.dev_handle, 
    item_info, byref(read_value_buffer), p_max_len)
    AssertSuccess(status, 'Read %s failed' % info)
    return read_value_buffer.value

......

  name = self.read_config_info(name_info)

当我试图读取一个罗马字符“I”时,它显示了一个奇怪的字符(GUI界面中“a”头上的一个点)。

如何对其进行编码,以便在GUI界面中显示罗马字符“I”?

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/51594