Ask Your Question
1

How to convert .sage to .py

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

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 13:08:39 +0100

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 13:22:52 +0100 )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 +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

1 follower

Stats

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

Seen: 1,573 times

Last updated: Feb 20 '13