...
Function | Object method |
---|---|
|
|
Calling user-defined Macro functions from Python
Any user-defined Macro function can be called from Python as long as it satisfies both of these criteria:
- the function must reside in a file of the same name as the function
- the file must be in a directory listed in the
METVIEW_MACRO_PATH
environment variable; this variable can be modified by the user, but by default it will include$HOME/metview/System/Macros
.
If these are satisfied, then the function may be invoked using the call()
command as shown here:
Code Block | ||
---|---|---|
| ||
import metview as mv
mv.call('my_func', 4, 1, 'my_string_arg')) |
The first argument is the name of the function, the subsequent arguments will be passed to the function.