Ask Your Question

How to convert .sage to .py

asked 2013-02-20 11:51:09 +0200

yefrem gravatar image


I created the file "example.sage" in my home directory and ran

sage: load "example.sage"

But Sage doesn't convert it to .py file, so I can't get the "" file. What should I do to get it? Actually, my goal is to write a GUI application, based on few sage classes. Can I do it without converting my sage code to the Python code?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-02-20 13:08:39 +0200

Running sage --preparse example.sage should convert example.sage into

edit flag offensive delete link more


Thank you very much! It worked. But now when I'm trying to run this file by python interpreter an error arises ImportError: No module named sage.all_cmdline

yefrem gravatar imageyefrem ( 2013-02-20 13:22:52 +0200 )edit

I think you should run this script with the python interpreter that comes with sage.

fidbc gravatar imagefidbc ( 2013-02-20 16:21:43 +0200 )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

1 follower


Asked: 2013-02-20 11:51:09 +0200

Seen: 1,458 times

Last updated: Feb 20 '13