Ask Your Question

as_butler's profile - activity

2019-10-22 16:21:28 +0200 received badge  Famous Question (source)
2018-02-22 00:39:27 +0200 received badge  Notable Question (source)
2018-02-22 00:39:27 +0200 received badge  Popular Question (source)
2017-02-11 11:45:43 +0200 received badge  Student (source)
2017-02-10 23:33:28 +0200 asked a question Import custom sage libraries into a Jupyter notebook

What is the correct way to write and import custom SAGE libraries into a jupyter notebook?

When using jupyter notebooks with a python kernel, importing your own python library is as easy as saving a file foo.py in the same directory as the notebook and putting animport foo line in the notebook. Using a SAGE kernel, I can import foo.py into my notebook, but without the ability to call SAGE methods: e.g. calling the function

def monty(n): return SymmetricGroup(n)

from foo.py gives the error,

NameError: global name 'SymmetricGroup' is not defined

My desired workflow: work in a notebook for convenience but be able to pass on what I've done in the form of a library.