Created
September 20, 2017 19:52
-
-
Save Carreau/7147c98fb3bf1fdd1636b5208e3ab80b to your computer and use it in GitHub Desktop.
import magic.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.core.magic import Magics, magics_class, line_magic | |
@magics_class | |
class Waskom(Magics): | |
@line_magic | |
def michael(self, line): | |
self.shell.set_next_input('import seaborn as sns') | |
ip = get_ipython() | |
ip.register_magics(Waskom) | |
# in a package | |
# def load_ipython_extension(ipython): | |
# ipython.register_magics(Waskom) | |
# and %load_ext, or set extension in conf file. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Response to https://twitter.com/michaelwaskom/status/910582112264359936