How to open a .py file

37 views
Skip to first unread message

Paul Gureghian

unread,
May 5, 2018, 12:29:17 PM5/5/18
to Project Jupyter
How to open a .py file in a new notebook? I know how to create a new notebook from scratch. How to import a local .py file into a notebook?  thanks 
Capture3.PNG
Capture4.PNG
Capture5.PNG
Capture6.PNG

Thomas Kluyver

unread,
May 5, 2018, 1:04:42 PM5/5/18
to Project Jupyter
You can copy/paste it, or you can run a cell containing "%load some_file.py". Sorry, there's no more obvious way to import code from a .py file.

On 5 May 2018 at 18:29, Paul Gureghian <paulgu...@gmail.com> wrote:
How to open a .py file in a new notebook? I know how to create a new notebook from scratch. How to import a local .py file into a notebook?  thanks 

--
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+unsubscribe@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/e899691a-c57d-4c78-b231-e614308a72c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Paul Gureghian

unread,
May 5, 2018, 1:19:17 PM5/5/18
to Project Jupyter
I was so fixated on importing it with menu items and mouse clicks I totally didn't even think of copying and pasting

Hard to believe it cant be imported with menu items. What is the exact syntax for the command to import it programmatically ?  



On Saturday, May 5, 2018 at 10:04:42 AM UTC-7, takowl wrote:
You can copy/paste it, or you can run a cell containing "%load some_file.py". Sorry, there's no more obvious way to import code from a .py file.
On 5 May 2018 at 18:29, Paul Gureghian <paulgu...@gmail.com> wrote:
How to open a .py file in a new notebook? I know how to create a new notebook from scratch. How to import a local .py file into a notebook?  thanks 

--
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.

Thomas Kluyver

unread,
May 5, 2018, 2:44:31 PM5/5/18
to Project Jupyter
On 5 May 2018 at 19:19, Paul Gureghian <paulgu...@gmail.com> wrote:
What is the exact syntax for the command to import it programmatically ?

Reply all
Reply to author
Forward
0 new messages