Ask Your Question

Revision history [back]

How to import rings in python module

I'm trying to build a sage 9 code into a format of python module with .py file, and run the module in the sage command line. Most of the issue could be fixed through this webpage by importing packages with command line such as


i.e. set up the sage environment manually. However, a built in mechanism in sage was the usage of rings. i.e. 1/3 in sage automatically returned 1/3 in rational ring, but when put the code in python module and run it in sage command line.

sage: module_name.value1

was in class 'float' or 'int'

How to set up the environment so that the module could run operation in sage rings automatically?