通过命令行运行paraview python

时间:2015-04-28 06:38:52

标签: paraview

有没有办法使用命令行运行paraview的python脚本。 现在我可以打开文件" python shell"在paraview中得到结果。我无法弄清楚通过命令行运行它。你能告诉我运行它的语法吗?

import os
i=0
SubDir = [" "]*30
# Set the directory you want to start from
rootDir = '/var/www/html/php/emd/job552e23fe74d102/VTK'
for dirName, subdirList, fileList in os.walk(rootDir):
    if dirName == rootDir + '/others':
       continue
    if dirName == rootDir:
       continue
    SubDir.append(dirName)
    i=i+1
    print('Found directory: %s' % dirName)
    for fname in fileList:
        print('\t%s' % fname)
        j=1
        j= LegacyVTKReader( FileNames=[dirName + '/' + fname] )

这是我的代码

1 个答案:

答案 0 :(得分:0)

你应该从bin中用pvpython调用脚本。

$(boot2docker shellinit)
  • 确保使用ParaView Python shell中的gui Trace选项,以确保您的代码在运行之前是正确的。
相关问题