Can we read local file from Sagecell
Can we read local file from Sagecell? I work with SageMathCell embedded on blog.
Can we read local file from Sagecell? I work with SageMathCell embedded on blog.
No, you can not read a local file from Sagecell. Sagecell is like any webserver, imagine the security hole if an arbitrary webserver you connect to with a webbrowser could read any file on your hard disk ! If you want to let Sagecell access some file, you have to serve it publically, this works well, see the answer of your other question.
Yes, you can:
with open("/path/filename", 'r') as fin:
print fin.read()
This is a way to read local files into a SageMath notebook on your own computer, but it won't work on SageMathCell: https://sagecell.sagemath.org/
Asked: 2017-10-27 09:01:43 -0600
Seen: 414 times
Last updated: Mar 05 '18
IPython.display.clear_output() functionality for SageMathCell.
Is there a package for sagecell ?
has aleph.sagemath.org disappeared?
how to print the printout not too long on Sagecell
Acces other cells from within other cells
how can SageCell read text file from url?
Sage cell server - do I really need so many makeSagecell invocations?
Hmm, that is a good question. I'd assume not unless you can read from the internet - some Sage functions allow URLs in them. But it wouldn't have access to your file system.
Thank you...