我正在尝试学习如何从命令行运行VisIt,并且我已经能够使用visit -cli
和提供 Python 命令(即 ieOpenDatabase("somefile.vtk")
等)来制作绘图。
除了ipython
口译员之外,还有其他方法可以做同样的事情吗?
我试过了
import visit
visit.OpenDatabase("somefile.vtk")
这给了我错误'module' object has no attribute 'OpenDatabase'
另一方面,如果我跑
import visit
visit.Launch()
visit.OpenDatabase("somefile.vtk")
...
VisIt GUI 已打开,之后的所有内容都visit.Launch()
将被忽略。
- 访问 2.6
- IPython 0.13
- Mac OSX 10.8.3
编辑:
import sys
print sys.path
蟒蛇
['',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MeshPy-2013.1-py2.7-macosx-10.8-x86_64.egg',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pytest-2.3.4-py2.7.egg',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pytools-2012.1-py2.7.egg',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py-1.4.13-py2.7.egg',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/decorator-3.4.0-py2.7.egg',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy-0.3.dev3763-py2.7-macosx-10.8-x86_64.egg',
'/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg',
'/Library/Python/2.7/site-packages/matplotlib-1.2.0-py2.7-macosx-10.8-intel.egg',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/lib/site-packages',
'/Users/lzkelley',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/readline',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
'/Users/lzkelley/Library/Python/2.7/lib/python/site-packages',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyObjC',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info',
'/Library/Python/2.7/site-packages',
'/Library/Python/2.7/site-packages/PIL',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython/extensions']
Python
['',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MeshPy-2013.1-py2.7-macosx-10.8-x86_64.egg',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pytest-2.3.4-py2.7.egg',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pytools-2012.1-py2.7.egg',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py-1.4.13-py2.7.egg',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/decorator-3.4.0-py2.7.egg',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy-0.3.dev3763-py2.7-macosx-10.8-x86_64.egg',
'/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg',
'/Library/Python/2.7/site-packages/matplotlib-1.2.0-py2.7-macosx-10.8-intel.egg',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/lib/site-packages',
'/Users/lzkelley',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/readline',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload',
'/Users/lzkelley/Library/Python/2.7/lib/python/site-packages',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PyObjC',
'/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg-info',
'/Library/Python/2.7/site-packages',
'/Library/Python/2.7/site-packages/PIL']
访问-cli
['',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/bin',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/lib/site-packages',
'/Users/lzkelley',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/lib/python/lib/python26.zip',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/lib/python/lib/python2.6',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/lib/python/lib/python2.6/plat-darwin',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/lib/python/lib/python2.6/plat-mac',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/lib/python/lib/python2.6/plat-mac/lib-scriptpackages',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/lib/python/lib/python2.6/lib-tk',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/lib/python/lib/python2.6/lib-old',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/lib/python/lib/python2.6/lib-dynload',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/lib/python/lib/python2.6/site-packages',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/lib/python/lib/python2.6/site-packages/PIL',
'/Users/lzkelley/Applications/visit/VisIt.app/Contents/Resources/2.6.1/darwin-x86_64/lib/site-packages']