I have Python 2.7 codes and I know that a random Python cannot use Sage as a Python library.
Without using "sage -python" or writing script, is there a way to get Sage output on my Python?
1 | initial version |
I have Python 2.7 codes and I know that a random Python cannot use Sage as a Python library.
Without using "sage -python" or writing script, is there a way to get Sage output on my Python?
2 | No.2 Revision |
I have Python 2.7 codes and I know that a random Python cannot use Sage as a Python library.library. So I made a script .sage in Python 2.7 and ran check_output command as follows.
from subprocess import check_output
def sage_code_run(var)
file = open("/path/to/file.sage", 'w')
data = "sage codes with input %s" % var
file.write(data)
file.close()
return check_output(["sage", "file.sage"])
Without using It works well, but it makes delay because of writing files. And I know "sage -python" or writing script, is -python", but it's not for 2.7.
Is there a way to get Sage output on my Python?Python 2.7?
3 | No.3 Revision |
I have Python python 2.7 codes and I know that a random Python python cannot use Sage sage as a Python python library. So I made a script .sage in Python python 2.7 and ran check_output command as follows.
from subprocess import check_output
def sage_code_run(var)
file = open("/path/to/file.sage", 'w')
data = "sage codes with input %s" % var
file.write(data)
file.close()
return check_output(["sage", "file.sage"])
It works well, but it makes delay because of writing files. And I know "sage -python", but it's not for 2.7.
Is there a way to get Sage sage output on Python 2.7?python?
4 | retagged |
I have python 2.7 codes and I know that a random python cannot use sage as a python library. So I made a script .sage in python 2.7 and ran check_output command as follows.
from subprocess import check_output
def sage_code_run(var)
file = open("/path/to/file.sage", 'w')
data = "sage codes with input %s" % var
file.write(data)
file.close()
return check_output(["sage", "file.sage"])
It works well, but it makes delay because of writing files. And I know "sage -python", but it's not for 2.7. Is there a way to get sage output on python?
5 | retagged |
I have python 2.7 codes and I know that a random python cannot use sage as a python library. So I made a script .sage in python 2.7 and ran check_output command as follows.
from subprocess import check_output
def sage_code_run(var)
file = open("/path/to/file.sage", 'w')
data = "sage codes with input %s" % var
file.write(data)
file.close()
return check_output(["sage", "file.sage"])
It works well, but it makes delay because of writing files. And I know "sage -python", but it's not for 2.7. Is there a way to get sage output on python?