Skip to content

nbconvert: Remove IPython magic commands from --format="python" output #3707

@dpsanders

Description

@dpsanders

nbconvert with the python output format:
ipython nbconvert --format="python"

currently leaves untouched the IPython magics, which get output to the .py.
This is a bug, since the output is no longer a valid Python script.

Indeed, even trying to run the output from the command line with ipython chokes on the magic commands (which is presumably another, separate, bug?)

Summary: the magics must be stripped out.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions