I have been using some jupyter notebook magics such as %matplotlib inline.
How to load them using python script instead of % signs.
Using jupyter
%load_ext sql
%config SqlMagic.displaycon=False
Question: How to do the same using script?
# file: myimports.py
from something import x
x.load_ext('sql')
x.config('SqlMagic.displaycon',False)
I want to use import * from myimports.py in jupyter notebook, so that I don't have to type %load_ext sql and so many things everytime I create new jupyter notebooks.
matplotlib. Not sure if there exists a rule for this.%matplotlibexample, what is your goal?%matplotlibis to set how the plotting output is handled in the notebook. If it is going to be a script run not connected to a display interface, then you don't want an equivalent for that. You may want to have it save a figure of your plot that you can view later, e.g.,plt.savefig("my_plot.png"). If you are going to return a plot that the notebook than can handle as previously set like the bottom of what @mosc9575 referenced, then you still don't include an equivalent because it would already be handled in the notebook.from myimports import *