Access local files from jupyter/scipy-notebook

34 views
Skip to first unread message

Arthur Goldberg

unread,
Dec 6, 2018, 12:12:06 PM12/6/18
to Project Jupyter
jupyter/scipy-notebook runs a local server. how does one reference local files in python code in a notebook using jupyter/scipy-notebook? 

Paul Hobson

unread,
Dec 6, 2018, 12:26:04 PM12/6/18
to jup...@googlegroups.com
Arthur,

If your server is running locally and in the same directory as your *.py files, you can import them like you would any other package.

If they are somewhere else, you'll need to append that directory to sys.path -- e.g., import sys; sys.path.append("/path/to/previous/work.py").

Does that answer your question?
-p

On Thu, Dec 6, 2018 at 9:12 AM Arthur Goldberg <artgo...@gmail.com> wrote:
jupyter/scipy-notebook runs a local server. how does one reference local files in python code in a notebook using jupyter/scipy-notebook? 

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/ae7a700c-f5aa-4b09-b26c-1aeedf834c0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Roland Weber

unread,
Dec 7, 2018, 6:48:42 AM12/7/18
to Project Jupyter
If you mean data files, just use an absolute path to the file location. But the user ID which is running the kernel will need to have access to that path and file.

cheers,
  Roland
Reply all
Reply to author
Forward
0 new messages