This package provides a basic interface to run Python code within Macaulay2 and to convert back and forth between Python and Macaulay2 objects.
i1 : toPython {1, 2/3, "foo", (1, 2, 3), hashTable {"foo" => "bar"}} o1 = [1, 0.6666666666666666, 'foo', (1, 2, 3), {'foo': 'bar'}] o1 : PythonObject of class list |
i2 : value rs "[1, 2/3, 'foo', (1, 2, 3), {'foo' : 'bar'}]" o2 = {1, .666667, foo, (1, 2, 3), HashTable{foo => bar}} o2 : List |
i3 : math = import "math" o3 = <module 'math' (built-in)> o3 : PythonObject of class module |
i4 : math@@sqrt 2 o4 = 1.4142135623730951 o4 : PythonObject of class float |
This documentation describes version 0.2 of Python.
The source code from which this documentation is derived is in the file Python.m2. The auxiliary files accompanying it are in the directory Python/.