Ask Your Question

Suppress automatically generated Python files when running Sage script

asked 2017-07-24 13:44:17 -0500


I'm curious if it is possible to stop Sage from automatically generating corresponding Python files. For instance, if I run a sage script test.sage, then after running sage test.sage, I'll get an automatically generated file called Is there any way to suppress the generation of this file? I tried to take a look in the documentation, but I couldn't find anything.

Thanks again!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-07-24 14:44:26 -0500

You can not avoid it. The way it works is

  1. Convert the .sage file into a .py file
  2. Execute the .py file

If you don't want extra files to be created, just use .py files directly. The .sage hides some work for you. The conversion .sage -> .py essentially consists in

  • writing the line from sage.all import * at the begining of the file
  • turn on the preparser. For example if you write 123 it will be understood as a Sage integer and not a Python integer.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-07-24 13:44:17 -0500

Seen: 28 times

Last updated: Jul 24