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.Thu, 27 Sep 2018 03:38:06 -0500Load module from remote serverhttp://ask.sagemath.org/question/43778/load-module-from-remote-server/Hi, I am using a remote sage notebook public server (such as http://sage.math.canterbury.ac.nz/).
I would like to be able to load my own python modules, but I don't know how can I access local files, such as
import sys
sys.path.append('path-to-file-in-my-local-drive')
import module-name
Is there any way to do that?jllbThu, 27 Sep 2018 03:38:06 -0500http://ask.sagemath.org/question/43778/How do I convert a notebook to a python script?http://ask.sagemath.org/question/8782/how-do-i-convert-a-notebook-to-a-python-script/I'm asking this because I'm starting a project and Sage seems like a very good platform to do some prototyping.
Better yet, it might be a great way to use the code that results from my prototyping directly has the final version as well.
But for that to work with a minimal of hardship though, a few things would be usefull:
1. A way to grab the code content of a notebook and generate an independent python script or function
2. A list of libraries, with version, that every sage version uses.
3. An instalable library version of sage that could be imported from the script
4. Anything else that I'm missing and you know sage can do to help in this task
I'm not asking for a completely automatic way to do this, just for resources/scripts or general advices about how to do it.
I'm also just starting to look into sage so, don't assume to much on what I may know. ;)
Thanks.Alexandre MartinsSat, 10 Mar 2012 07:58:00 -0600http://ask.sagemath.org/question/8782/docstring for my .py files does not work in Sage Notebook [UPD1]http://ask.sagemath.org/question/10629/docstring-for-my-py-files-does-not-work-in-sage-notebook-upd1/Hello!
Sage 5.10, Linux Mint 15 Cinnamon. <br>
I created new directory "pycode" in /home/andrei/ <br>
There is one file my_func.py in /home/andrei/pycode <br>
The context of my_module.py:
import sage.all
def my_func(a, b, c):
"""
hello!
"""
return(a+b+c)
In Sage Notebook I do the next:
import sys # 1st cell
sys.path.append('/home/andrei/pycode/') # 2nd cell
import my_module # 3rd cell
my_module.my_func? # 4 cell
I don't see any docstring in Sage Notebook. Where is the error? Please help me. Thanks.
----------------------------------------
**UPD1:**
I found the answer! :)
First of all I turned off and then launched sage notebook. After that I saw my docstring. Then I use Action... --> Restart worksheet.
Please explain me why shift+enter doesn't work for me. Thanks.
AndreWinSat, 19 Oct 2013 00:24:54 -0500http://ask.sagemath.org/question/10629/