Ask Your Question

Interface between Sage and Python

asked 2015-04-22 15:33:08 -0500

chan.y.park gravatar image


I wonder if there is a way (or an API) that one can use Sage inside a Python code.

More specifically, I have a system of equations defined inside a big Python code, and I want to make Sage solve the equations and give the solutions back to Python.

Using the Python of Sage is out of option, unfortunately. Rather, I want to 'import' Sage onto Python and use its functionality as I import other Python libraries.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2015-04-23 04:32:28 -0500

tmonteil gravatar image

updated 2015-04-23 06:21:21 -0500

To use Sage from a Python script, you indeed have to use Sage's Python, since various environment variables are set up (PATH, etc), see this page.

Could you please explain why using the python of Sage is out of option ? What prevents you to follow the instructions above ? Perhaps this problem will be easier to solve.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2015-04-22 15:33:08 -0500

Seen: 251 times

Last updated: Apr 23 '15