Ask Your Question
1

How to convert .sage to .py

asked 12 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 12 years ago

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

Preview: (hide)
link

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 ( 12 years ago )

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

fidbc gravatar imagefidbc ( 12 years ago )

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: 12 years ago

Seen: 1,623 times

Last updated: Feb 20 '13