ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 21 Jan 2021 07:10:55 +0100How to import rings in python modulehttps://ask.sagemath.org/question/55403/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 https://doc.sagemath.org/html/en/tutorial/programming.html by importing packages with command line such as
import_statements('is_integer')
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?ShoutOutAndCalculateThu, 21 Jan 2021 07:10:55 +0100https://ask.sagemath.org/question/55403/