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

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.

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容