【发布时间】:2016-03-27 04:25:50
【问题描述】:
我在玩 graph_tool 时注意到了这一点。某些模块属性似乎仅在从 ipython 运行时可用。最简单的例子(example.py)
import graph_tool as gt
g = gt.Graph()
gt.draw.sfdp_layout(g)
使用run example.y', but from the command line,python example.py`从ipython运行时没有错误
AttributeError: 'module' object has no attribute 'draw'
ipython example.py 也是如此。我不知道是什么原因造成的。我想访问绘图模块,但似乎我只能通过from graph_tool.draw import * 进行此操作,任何帮助或解释将不胜感激。
【问题讨论】:
标签: python ipython python-import graph-tool