On Jan 28, 8:32 am, Pat LeSmithe <[email protected]> wrote:
...
> I think it'd be great to be able to "import sage" to access
> Sage's command-line capabilities inside VisIt and ParaView. Is this
> possible?
Sage ships with its own copy of Python, etc.; and it's only supported
to use Sage with its internal Python installation. So to have VisIt
or ParaView in the same process as Sage, they would have to use Sage's
Python installation; that is, you would have to install them "into"
Sage.
Often, this process is straightforward:
run:
sage -sh
to create a subshell with environment variables (paths, etc.) set up
for Sage.
Within this subshell, install your package in the usual way.
Now, to run things.
option 1: using Sage from within other package
While still in the "sage -sh" subshell, run your package.
Do:
import sage.all
The sage.all module has all the functions that are available on the
Sage command line, so now you could do, for instance:
sage.all.RealField(500).pi()
to compute pi to 500 bits.
You must do "import sage.all" first, even if you want to import
individual functions from individual modules; "import sage.all" makes
sure to load everything in the right order.
option 2: using other package from within Sage
exit your "sage -sh" subshell
run sage
Do:
import other.package
Note that I haven't actually tried this with VisIt or ParaView.
Carl
--~--~---------~--~----~------------~-------~--~----~
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-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---