Multiple vars and arrays using PythonFile
I can use the PythonFile command to get both a single var and a single array from a python file using a single call.
I cannot see a way to get multiple variables and/or multiple arrays from a single PythonFile command.
Is there a way to do this?
Right now there isn't any syntax for returning multiple variables/arrays back at once, only one of each. However, I can think of two ways to do this, usually I do (1):
1. After running `PythonFile`, make a second call to `Python` that doesn't run any code, but simply requests the variable or array. You can do this any number of times.
2. If you're trying to return more than a couple arrays/variables, you might be better suited to create a wave reference wave from Python, put the arrays inside it, and return that to Igor as a single wave. The same could be done with your variables, by packing them into a wave. You still might be left making multiple calls to `Python` though. For instance, you'd do something like this in Python and then return the `refs` wave back to Igor.
Hope that helps
January 8, 2026 at 09:36 am - Permalink