How to properly evaluate sage code from within a Python script
问题 I've been trying to evaluate a simple "integrate(x,x)" statement from within Python, by following the Sage instructions for importing Sage into Python. Here's my entire script: #!/usr/bin/env sage -python from sage.all import * def main(): integrate(x,x) pass main() When I try to run it from the command line, I get this error thrown: NameError: global name 'x' is not defined I've tried adding var(x) into the script, global x , tried replacing integrate(x,x) with sage.integrate(x,x) , but I