Hi Mikie,

On Tue, Aug 18, 2009 at 7:16 AM, Mikie<thephantom6...@hotmail.com> wrote:
>
> How do I load Maxima?  I using a Python script.

If you want to access the Sage library from your Python script, you
need to run that script using the version of Python that comes with
Sage. The command "sage -python /path/to/my/python/script.py" should
do the trick. To access the functionalities of Maxima from that
script, you can pass all Maxima commands to the function maxima(). For
example, say I have a Python script as follows and Sage is in my PATH:

[mv...@sage mvngu]$ which sage
/usr/local/bin/sage
[mv...@sage mvngu]$ pwd
/scratch/mvngu
[mv...@sage mvngu]$ cat demo.py
from sage.all import *

print maxima("2 + 3;")

I would then run the Python script "demo.py" as follows:

[mv...@sage mvngu]$ sage -python demo.py
                                       5

and the answer 5 is the output of the version of Maxima that's bundled
with Sage.

-- 
Regards
Minh Van Nguyen

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to