importing functions from other worksheets

17 views
Skip to first unread message

Peter

unread,
Nov 8, 2009, 12:23:22 PM11/8/09
to sage-support
If I have one worksheet, say "global functions", that defines several
general functions that all students should have access to, can they
easily include the latest version of the code from this worksheet into
their own worksheet with something similar to an "attach" or "import"
command at the top?

Or what other solutions are instructors using to address similar
problems? Is it recommended to add function definitions to the
init.sage file?

I suppose it is quite easy to put these functions into a global.sage
file and attach the file, but then the programs in this file have to
be developed in a terminal window rather than in the notebook (unless
I can figure out a simple way to save all input cells of the "global
functions" worksheet to a file global.sage on the server that is
accessible to all users).

Any suggestions are appreciated.

Thanks,
Peter

William Stein

unread,
Nov 8, 2009, 12:42:17 PM11/8/09
to sage-s...@googlegroups.com
On Sun, Nov 8, 2009 at 9:23 AM, Peter <peter....@gmail.com> wrote:
>
> If I have one worksheet, say "global functions", that defines several
> general functions that all students should have access to, can they
> easily include the latest version of the code from this worksheet into
> their own worksheet with something similar to an "attach" or "import"
> command at the top?

No.

>
> Or what other solutions are instructors using to address similar
> problems? Is it recommended to add function definitions to the
> init.sage file?
>
> I suppose it is quite easy to put these functions into a global.sage
> file and attach the file, but then the programs in this file have to
> be developed in a terminal window rather than in the notebook (unless
> I can figure out a simple way to save all input cells of the "global
> functions" worksheet to a file global.sage on the server that is
> accessible to all users).

That is the current solution.

William

Reply all
Reply to author
Forward
0 new messages