# Revision history [back]

A very simple way of adding a fixed piece of code to the worksheet is to put it on a web server somewhere and then add the line

load('http://my.webserver.com/path/to/code.py')


at the beginning of the worksheet. Evaluating that will load the code from the web server.

If you are using the VirtualBox image then the notebook server is running on the console. If you want to go back to the Sage command line, you have to press Ctrl-C first to stop the notebook server. This will drop you to the unix shell, where you can start the sage command line. That is, after pressing Ctrl-C you see the [sage@sage sage]$prompt, type sage and press return. Then you can directly work with the Sage command line. Using the unix shell, you can also poke around in the virtual machine. Using the VirtualBox appliance, you could share a folder on your host computer. In VirtualBox, click on Shared Folders and pick a folder. Give it the name Shared, say. Then, on the unix command line in the virtual machine, type sudo mount -t vboxsf Shared /mnt  This will make the shared folder appear at /mnt inside the virtual machine. Then you can follow http://ask.sagemath.org/question/732/how-can-i-share-code-between-worksheets and, for example, use %auto attach('/mnt/mycode.py')  A very simple way of adding a fixed piece of code to the worksheet is to put it on a web server somewhere and then add the line load('http://my.webserver.com/path/to/code.py')  at the beginning of the worksheet. Evaluating that will load the code from the web server. If you are using the VirtualBox image then the notebook server is running on the console. If you want to go back to the Sage command line, you have to press Ctrl-C first to stop the notebook server. This will drop you to the unix shell, where you can start the sage command line. That is, after pressing Ctrl-C you see the [sage@sage sage]$ prompt, type sage and press return. Then you can directly work with the Sage command line. Using the unix shell, you can also poke around in the virtual machine.

Using the VirtualBox appliance, you could share a folder on your host computer. In VirtualBox, click on Shared Folders and pick a folder. Give it the name Shared, say. Then, on the unix command line in the virtual machine, type

sudo mount -t vboxsf Shared /mnt


The password is sage. This will make the shared folder appear at /mnt inside the virtual machine. Then you can follow http://ask.sagemath.org/question/732/how-can-i-share-code-between-worksheets and, for example, use

%auto
attach('/mnt/mycode.py')