Questions tagged [ipython-magic]

A set of pre-defined "magic functions" of IPython that used with the command-line syntax.

A set of pre-defined "magic functions" of that used with the command-line syntax. There are two types of magic functions line-oriented and cell-oriented. The lines start with a magic % and executed from the command line. They get into an argument the rest of the line, where the arguments are passed without parentheses and quotation marks. Cell magic begins with the double %%, and they are functions that get in an argument not only the rest of the line, but the line below it in a separate argument.

169 questions
0
votes
1 answer

Catching Syntax Errors from iPython Kernel

The way to connect, run, display, show errors over inprocess ipython kernel is import re, sys, time, os from StringIO import StringIO from IPython.kernel.inprocess.blocking import BlockingInProcessKernelClient from IPython.kernel.inprocess.manager…
BBSysDyn
  • 4,389
  • 8
  • 48
  • 63
0
votes
1 answer

How to add new types of files when using python-magic library?

I need to use a python library for identifying the file type, and after reading the posts on this subject, python-magic seems to be what I am looking for. However, I can't find in the documentation how can I add new types of files when using this…
Clara
  • 2,935
  • 6
  • 34
  • 49
-1
votes
1 answer

Import functions that use ipython magic

In ipython cells you can execute shell commands as follows: ipython: print("asdf") !echo asdf However, if you try to import this code from file, asdf.py: def asdf(): print("asdf") !echo asdf ipython: from asdf import asdf it results in an…
Entrack
  • 51
  • 1
  • 1
  • 10
-1
votes
1 answer

Packaging a Python project and its associated IPython magic extension

I am in the process of deploying to Pypi a Python project, let's call it foobar. I would like to distribute it with a shell command and an IPython magic command. I use Poetry, and the relevant part of my .toml configuration file is: …
Aristide
  • 3,606
  • 2
  • 30
  • 50
1 2 3
11
12