Ask Your Question

Interface between Sage and Python

asked 2015-04-22 22:33:08 +0100

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 11:32:28 +0100

tmonteil gravatar image

updated 2015-04-23 13:21:21 +0100

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 22:33:08 +0100

Seen: 349 times

Last updated: Apr 23 '15