•
|
The new OpenMaple for Python is an interface for the Python programming language that allows you to access Maple algorithms and data structures from a Python session on the same machine.
|
•
|
You can use OpenMaple for Python from any Python session or within Maple from a Python Code Edit Region.
|
|
Using Maple commands and symbols in Python
|
|
There are two ways to make use of Maple commands and symbols in the OpenMaple API: using maple.symbols or maple.namespace.
•
|
maple.symbols lets you specify a list of symbols as a string. You can then assign these to Python variables and use them freely.
|
•
|
maple.namespace lets you reference any symbol from Maple with a simple prefix.
|
|
|
Conversions
|
|
OpenMaple for Python can perform automatic conversions when Python objects are used as input to Maple, allowing results computed using
Python type
|
Maple type
|
dict
|
table
|
list
|
list
|
set, frozenset
|
set
|
Fractions.fraction
|
fraction
|
sympy.Basic
|
anything
|
|
|
|
|
Python commandline flag
|
|
The Maple commandline script on macOS and Linux now accepts an additional flag, -python, which launches the version of Python distributed with Maple. This is automatically configured to enable OpenMaple for Python to work.
To use it simply type maple -python in a terminal window and then enter import maple to load OpenMaple for Python.
|