On Jul 23, 9:16 am, VictorMiller <victorsmil...@gmail.com> wrote:
> I have a sage program in a file in one of my directories called
> calc.sage.  It uses a class that I wrote called Table, which I've put
> in a file called Table.py in the same directory.  In the sage notebook
> I load calc.sage (by explicitly giving the path to the directory), and
> calc.sage has a line
>
> from Table import Table
>
> However, when I try to run it it can't find Table.py.  So, the
> question is, what is the path that sage uses for import, and how do I
> change it?  Is there a way to do this without having to include
> explicit path qualification in the files?
>
> Victor

Here is some more data: I created three files:

dga.py  -- contains the definition of a class Lambda
new.py  -- contains the line "from dga import Lambda"
temp.sage  -- identical to new.py

>From the command-line, running "load ...path.../new.py" works just
fine.  On the other hand, running "load ...path.../temp.sage" does
not: it complains about not being able to find the module "dga".  From
the notebook, neither works: they both complain about not being able
to find "dga".

So there is a difference between FILE.py and FILE.sage, and there is
also a difference between running from the command-line vs. the
notebook.  Can anyone illuminate any of this?

  John

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

Reply via email to