First time here? Check out the FAQ!

Ask Your Question
2

How to share files across worksheets ?

asked 13 years ago

Pedro gravatar image

updated 13 years ago

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 ?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 13 years ago

kcrisman gravatar image

updated 13 years ago

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.

Preview: (hide)
link

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

Seen: 613 times

Last updated: Jun 09 '11