Yes, that works.
However, I am trying to create a function that has Maxima functions in
it and I can't seem to pass values to it.  I am using a Python
function.

Something like this
-----------------------
def Subs(x,y):
    y1=maxima("float(x);");y1
    maxima("p1:y1;");print maxima("p1;")
    a1=maxima("s3:x*y;");
    return a1
-------------------------
Is it possible to pass the variables into Maxima function?


On Aug 18, 5:30 am, Minh Nguyen <[email protected]> wrote:
> Hi Mikie,
>
> On Tue, Aug 18, 2009 at 7:16 AM, Mikie<[email protected]> 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to