Ask Your Question

Where should I put a user defined function?

asked 2013-03-16 01:22:58 +0200

If I wrote a function and want it to be available in sage as a global function (not in a single worksheet), where should I put it ? I mean what directory within sage directory tree ?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-03-16 08:58:53 +0200

ndomes gravatar image

updated 2013-03-16 09:02:37 +0200

Provided you have access to the Sage directory tree, you may put it in an appropriate subfolder of


for example in


Let's say your file is named, then

from sage.misc.myfunctions import *

will give you access to all functions defined in

edit flag offensive delete link more


No module named 'myfunctions'

Kushan.skm gravatar imageKushan.skm ( 2013-03-20 04:01:51 +0200 )edit

Do you think I should modify `sage-x.y/devel/sage/sage/misc/` ?

Kushan.skm gravatar imageKushan.skm ( 2013-03-20 04:07:30 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-03-16 01:22:58 +0200

Seen: 417 times

Last updated: Mar 16 '13