ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 28 Jun 2016 11:14:23 -0500Can I create a sage file, and import it as a Python module?http://ask.sagemath.org/question/33954/can-i-create-a-sage-file-and-import-it-as-a-python-module/ I am trying to create a file that produces some data using sage specific modules (eg graphs. ).
Is there a way that I can save this file and then import it in a Python shell and / or in a Sage shell?
The problems I have encountered so far are:
- if I try to save the file as filename.py and import it as a module in a Python or Sage shell, Python/ Sage won't recognize the sage specific functions (which makes sense)
- if I try to save the file as filename.sage and import it as a module in a Sage shell, I get the error "No module named filename"
I am working from an Ubuntu terminal.
Thank you!silvia_n_netsTue, 28 Jun 2016 11:14:23 -0500http://ask.sagemath.org/question/33954/