Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

load python file in jupyter notebook

A text file can be loaded in a notebook cell with the magic command %load.

If you execute a cell containing:

%load filename.py
the content of filename.py will be loaded in the next cell. You can edit and execute it as usual.

To save the cell content back into a file add the cell-magic %%writefile filename.py at the beginning of the cell and run it. Beware that if a file with the same name already exists it will be silently overwritten.
Comment

how to open a jupyter notebook in your files

navigate to your file's directory in the command line using cd ~/path/to/directory_of_file
type: jupyter notebook
press enter (of course)
it will launch a server from your directory and open a jupyter tab in your browser
Comment

PREVIOUS NEXT
Code Example
Python :: create login system in python 
Python :: remove decimal python 
Python :: how to make a button in python 
Python :: np ln 
Python :: Publish Image msg ros python 
Python :: python requests no certificate example 
Python :: r named chr to dataframe 
Python :: python dropbox 
Python :: how to host python flask web application 
Python :: python constant 
Python :: raising custom exception python 
Python :: django-mathfilters 
Python :: numpy savetxt list of strings 
Python :: add list to end of list python 
Python :: count number items in list python 
Python :: convert string to float python 
Python :: best fit line python log log scale 
Python :: check for string in list pytho 
Python :: how to plot in python 
Python :: python switch columns order csv 
Python :: change data type python 
Python :: register template tag django 
Python :: cronometer python 
Python :: python chat 
Python :: python read file xlsx and return a list 
Python :: python subset 
Python :: python recursion factorial 
Python :: box plot python 
Python :: gradient descent python 
Python :: two groupby pandas 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =