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):<br>
<br>
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: 'Courier'; font-size: 10pt; color: rgb(0, 0, 0);">>>> os.listdir(".")</span></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: 'Courier'; font-size: 10pt; color: rgb(0, 150, 0);">['IterateOpenSources.py', 'IterateOpenSources.py~', 'LoadMultipleFiles.py', 'LoadMultipleFiles.py~', 'Sphere.py']</span></p>
<p style="margin: 0px; text-indent: 0px;"><span style="font-family: 'Courier'; font-size: 10pt; color: rgb(0, 0, 0);">>>> from LoadMultipleFiles import *</span></p><br>and here is the contnets of LoadMultipleFiles.py<br>
--------------------------<br>#!/usr/bin/pvpython<br>def LoadMultipleFiles(FilePrefix, Low, High):<br> #setup paraview connection<br> from paraview import servermanager<br><br> if not servermanager.ActiveConnection:<br>
connection = servermanager.Connect()<br><br> pm = servermanager.ProxyManager()<br> #actually do something here<br>---------------------------<br><br>You can see the function requires a couple of parameters - how can I pass them?<br>
<br clear="all">Thanks,<br><br>David<br>