Ask Your Question
2

How to share files across worksheets ?

asked 2011-06-02 07:27:23 +0100

Pedro gravatar image

updated 2011-06-16 15:24:46 +0100

Kelvin Li gravatar image

I want that code in several worksheets, from the same user, work over the same files. The DATA variable works only for the worksheet that uses it in a cell.

More, inside a new package: how to produce a path to that common directory over all worksheets of an user ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2011-06-03 09:18:48 +0100

kcrisman gravatar image

updated 2011-06-09 15:43:12 +0100

This isn't possible with DATA, as you mention, unfortunately.

But there is the following workaround if you have permissions on your computer (for instance). I don't know whether this would work on a server, though presumably it might if you chmod the file in question appropriately?

Suppose you have a file you want to use at /Users/myusername/Downloads/List3000.sobj. Then

L = load('/Users/myusername/Downloads/List3000')

works in the notebook. I don't see any reason that as many worksheets as possible couldn't do that. You would need the full path, though.

The reason this works is because DATA just gives a full path as a string too:

sage: DATA
'/Users/myusername/.sage/sage_notebook.sagenb/home/admin/171/data/'

Edit:

However, you can make a file accessible to other worksheets that you own by going to the Data dropdown menu, choosing the file, and then doing "create a linked copy to the worksheet" and choosing a worksheet. I don't know if this would help with your case or not.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-06-02 07:27:23 +0100

Seen: 600 times

Last updated: Jun 09 '11