Ask Your Question
1

How to convert .sage to .py

asked 2013-02-20 04:51:09 -0500

yefrem gravatar image

Hi!

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 "example.sage.py" 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
2

answered 2013-02-20 06:08:39 -0500

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

edit flag offensive delete link more

Comments

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 06:22:52 -0500 )edit

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

fidbc gravatar imagefidbc ( 2013-02-20 09:21:43 -0500 )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

Stats

Asked: 2013-02-20 04:51:09 -0500

Seen: 153 times

Last updated: Feb 20 '13