In the python shell, there is a "Run Script" button. It seems that you can
only run scripts that do not require parameters? If I have a python function
in a .py file, how would I call it? In normal python, I would import the
function like this (the listdir was just to show you I was in the correct
directory):

 >>> os.listdir(".")

['IterateOpenSources.py', 'IterateOpenSources.py~', 'LoadMultipleFiles.py',
'LoadMultipleFiles.py~', 'Sphere.py']

>>> from LoadMultipleFiles import *

and here is the contnets of LoadMultipleFiles.py
--------------------------
#!/usr/bin/pvpython
def LoadMultipleFiles(FilePrefix, Low, High):
    #setup paraview connection
    from paraview import servermanager

    if not servermanager.ActiveConnection:
        connection = servermanager.Connect()

    pm = servermanager.ProxyManager()
    #actually do something here
---------------------------

You can see the function requires a couple of parameters - how can I pass
them?

Thanks,

David
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to