Dear Leif,

thank you for the amazing and trivial suggestion

>> Adding your directory where m1.py and m2.py live to SAGE_PATH and
>> running (e.g.)

This link is related:

http://ask.sagemath.org/question/415/how-do-i-get-sage-to-honor-my-pythonpath

So this info could be in Sage Developers manual.

Pedro


2011/8/25 leif <not.rea...@online.de>

> On 25 Aug., 10:13, Pedro Cruz <pedrocruzave...@gmail.com> wrote:
> > Dear Maarten Derickx (and Sage developers)
> >
> > thank you for reply.
> >
> > Using:
> >   sage -t /home/jpedro/sage/local/lib/python2.6/site-packages/
> > meg/paramparse.py
> > causes "ImportError" as before but if I use
> >   sage -python -m doctest paramparse.py
> > using ">>>" instead of "sage:" everything works on each module.
> >
> > The problem occurs in this small example:
> >
> > $ sage -t m1.py
> >
> > WHERE:
> >
> > FILE m1.py ----------------
> > from sage.all_cmdline import * # import sage library
> > from m2 import funfun
> > def square(n):
> > """
> > Return the square of n.
> >  EXAMPLES::
> >     sage: square(2)
> >     8
> > """
> > return n**2 * funfun(n)
> >
> > FILE m2.py -------------------------
> > def funfun(n):
> > return n
> >
> > Again, something wrong with "import m2". (Sage 4.7)
> > I believe that "sage -t" works well only:
> > (1) for a single file.
> > (2) for a package that is being build inside sage structure.
>
> Adding your directory where m1.py and m2.py live to SAGE_PATH and
> running (e.g.)
>
> sage -t /path/to/m1.py
>
> should just work.
>
>
> -leif
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to
> sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

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

Reply via email to