美文网首页
Python内置hex()函数与PyQt4的hex()函数冲突

Python内置hex()函数与PyQt4的hex()函数冲突

作者: clhon | 来源:发表于2018-04-11 15:41 被阅读0次

Pre-conditions:

Import all PyQt libs into Python project(or just one .py file)

Result:

Compiling error such as "Type error of hex(QTestString), the expect type is QTestString" occurs when calling the hex() function.

Solution:

There are 2 solutions so far (for me):

a. Don't import all QT packages into the .py, just the needed ones.

b. Realize your own HEX() function in another .py, which import no QT module, and import this package in you main .py.

相关文章

网友评论

      本文标题:Python内置hex()函数与PyQt4的hex()函数冲突

      本文链接:https://www.haomeiwen.com/subject/rlczhftx.html