Ask Your Question

How to save my work locally

asked 2017-02-17 04:00:26 -0600

python_15 gravatar image


I'm new with SageMath, but after some days reading and working I'm quite familiar with the main concepts, so working in the terminal an the notebook isn't a problem for me now. The problem I have is: How can I save the code I wrote locally, in a .sage-file on my drive or something like that? How can I organize my work well?

I haven't fount anything in tutorials, maybe someone could give me an explanation or a useful link! (:

Thanks a lot, python_15

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-02-17 08:09:13 -0600

tmonteil gravatar image

updated 2017-02-17 08:11:02 -0600

From the command line, you can define your classes/functions/variables within a my_file.sage and attach it to your session by typing:

sage: %attach /path/to/my_file.sage

and then, the file is executed. It is re-executed each time you save the file, so that you do not have to re-load it again.

If you do not want the sage preparser to take effect so that your file is understood as a python file, you should name your file

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-02-17 04:00:26 -0600

Seen: 26 times

Last updated: Feb 17