On Feb 9, 3:02 pm, William Stein <[email protected]> wrote:
> On Tue, Feb 9, 2010 at 10:17 AM, kcrisman <[email protected]> wrote:
> > Dear support,
>
> > Suppose I want to refer to a file in a notebook cell directory from
> > inside that cell. How do I access that path 'easily'?
> > os.path.abspath('.') seems to not do what I expect, but just referring
> > directly to the file also raises an error. I would use
> > Cell.directory() or Cell.id() but don't know how to get a reference to
> > the cell I am in that way either.
>
> What *precisely* do you really want to do. The above question is too
> general. In general you can't do the above, due to security
> restrictions.
>
I want to get a reference to the cell. This is related to my other
question (viewing graphics files). In one cell, I would like to do
make_graphics_file('foo.png') # NOT a Sage object, a graphics file
view_graphics_file('foo.png') # the exact same graphics file I just
created
The other support request was about what command (if any) might do the
second line in general, which Harald (sort of) answered. This
question is just about how to access ...sage_notebook.sagenb/home/
admin/worksheet/xx/cells/yy/foo.png , which is more or less where such
a graphic lives - because even his idea doesn't work in the notebook,
at least not directly, without knowing the path (just 'foo.png' raises
an error for some reason).
Maybe I should have concatenated the two questions into one, my
apologies - though I thought they were separately interesting enough
to not obscure them by putting them together.
- kcrisman
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org