On Sat, Jan 3, 2009 at 1:29 PM, gerhard <[email protected]> wrote:
>
> I used IPythonShellEmbed to embed python (and sage) in my own code,
> and got it to work from the command line, giving me access to my own
> code as a built in module.
>
> Trying to switch to the notebook interface however looses
> access to the module. Where would I need to look
> to figure out what might be going wrong there?

I don't actually at all understand what you're trying to do based on
your description.   Could you provide some more details.  For
starters, I've never heard of IpythonShellEmbed, and don't know what
it's supposed to accomplish.

Just one note -- there is no relationship code-wise between Ipython
and the Sage notebook.

Thanks,

 -- William

>
> Thanks,
> -gerhard
> ------------------------
> for reference, I initialized IPython with
>
> import IPython
> from IPython.Shell import IPShellEmbed
>
> import os
> import sys
> import new
>
> __SAGE_AUTOINJECT__ = True
>
> ipy_sage = IPShellEmbed(argv=['-p', 'sage' ])
>
>
> old_system = ipy_sage.IP.system
> sage_commands = os.listdir(os.environ['SAGE_ROOT']+'/local/bin/')
> DARWIN_SYSTEM = os.uname()[0]=='Darwin'
>
> def sage_system(self, cmd):
>    if cmd in sage_commands:
>        old_system(cmd)
>    else:
>        libraries = 'LD_LIBRARY_PATH=$$SAGE_ORIG_LD_LIBRARY_PATH;'
>        if DARWIN_SYSTEM:
>            libraries += 'DYLD_LIBRARY_PATH=$
> $SAGE_ORIG_DYLD_LIBRARY_PATH;'
>        old_system(libraries+cmd)
>
> ipy_sage.IP.system = new.instancemethod(sage_system, ipy_sage.IP,
> IPython.iplib.InteractiveShell)
>
> ipy_sage()
> >
>



-- 
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

--~--~---------~--~----~------------~-------~--~----~
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