【发布时间】:2015-12-27 05:10:53
【问题描述】:
下面的代码打印 wx.ACCEL_NORMAL 好了
import wx.gizmos
# import wx # uncommenting this the warning is eliminated
print wx.ACCEL_NORMAL # Pycharm warns: "Cannot find reference 'ACCEL_NORMAL'
# in imported module wx" but finds it alright when i run it
两个问题:
- 它怎么看wx?
- 为什么会发出警告?它是否与 wx (2.8.12.1) 特性有关,或者是预期的,还是 Pycharm 错误或...?
编辑:
可能是下面的 wx 事情不会发出警告:
import os.path
print os.name
但 Q1 仍然存在
EDIT2:
将导入更改为
import wx.gizmos as gizmos
我得到了预期:
Traceback (most recent call last):
File "/home/utumno/.PyCharm40/config/scratches/scratch", line 5, in <module>
print wx.ACCEL_NORMAL # Pycharm warns: "Cannot find reference 'ACCEL_NORMAL'
NameError: name 'wx' is not defined
【问题讨论】:
标签: python python-2.7 packages python-import