Ask Your Question
1

Sage relation to Python

asked 2011-04-30 02:35:54 +0100

dartdog gravatar image

Bear with me here.. I'm still struggling to use regular Python with Idle Ipython and the like.. And also Sage.

What I'm not real clear on is if I can treat Sage Notebook as another Python Development environment?

If so how do I save and recall, execute and edit plain .py files in Sage.. I've probably just missed it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2011-04-30 05:54:27 +0100

Felix Lawrence gravatar image

The Sage notebook doesn't replace a good text editor. It's fantastic for writing 'on the fly' code and for calling pre-written functions, but as far as I know, there's no handy GUI in the notebook for opening, manually editing and saving .py files.

There is, however, very neat support for executing .py and .sage files. The load and attach commands are explained in the tutorial and work both for .sage files and for .py files. attach will automatically reload the file every time it is changed. The preparser is not called for .py files, so you have to import any sage functions that you want to use.

You can set the path for load and attach using load_attach_path.

edit flag offensive delete link more

Comments

1

That helps a lot. It fills in a few missing pieces for me! So it seems that I could have Vim open side by side and use Sage as the execution environment, much like I'm doing with Ipython now...

dartdog gravatar imagedartdog ( 2011-04-30 12:46:36 +0100 )edit
1

I find that the Sage Notebook is an excellent environment for experimenting with code and for building a feature or fixing a bug. Once I've worked out the kinks I then turn to implementing my results in a Python file or by creating a patch. The Notebooks is mighty convenient for experimentation!

cswiercz gravatar imagecswiercz ( 2011-04-30 15:15:13 +0100 )edit

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2011-04-30 02:35:54 +0100

Seen: 738 times

Last updated: Apr 30 '11