Ask Your Question

Revision history [back]

As Thierry suggested you would better use .py files. A quick conversion can be done from the console with

$ sage -preparse my_file.sage

Note that the produced file will be my_file.sage.py which makes it unusable from Sage as a modue!! So first change its name

$ mv my_file.sage.py my_file.py

And then you can use it from a Sage console

sage: import my_file

As Thierry suggested you would better use .py files. A quick conversion can be done from the console with

$ sage -preparse my_file.sage

Note that the produced file will be my_file.sage.py which makes it unusable from Sage as a modue!! module! So first change its name

$ mv my_file.sage.py my_file.py

And then you can use it from a Sage console

sage: import my_file