Hi Chris, >From foo.py, you should import the Sage libraries with "import sage.all". If you don't want to use the libraries directly, and want a Sage process like you'd get if you were sitting down at the command-line, you can use "sage0". For examples of how this is used, start up sage and run "sage0?" In your Python program, you'd use something like "s = Sage()" and use the s object to interact with a separate Sage process.
--Mike On Fri, Apr 4, 2008 at 1:43 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > On Apr 3, 12:44 pm, Robert Bradshaw <[EMAIL PROTECTED]> > wrote: > > > > "sage -python" simply runs the version of Python that sage installed, > > which is the one that has all the Sage libraries imported into it. > > "sage -python my_big_web_app.py" should work fine. > > OK so "sage -python foo.py" is like doing "python ./foo.py". That's > good. > > 1. How find say "4+5" from foo.py? answer = sage("4+5") ??? > I really don't need to import anything or do anything special? > > 2. Will it maintain state just as if I was sitting at a Sage console? > > Chris > > > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---