module ipythonhelper.magic_class_diff
¶
Classes¶
class |
truncated documentation |
---|---|
Defines magic commands to visualize differences between files. |
Functions¶
function |
truncated documentation |
---|---|
Register magics function, can be called from a notebook. |
Properties¶
property |
truncated documentation |
---|---|
|
return the context or None |
|
A contextmanager for running a block with our cross validation lock set to True. At the end of the block, … |
Static Methods¶
staticmethod |
truncated documentation |
---|---|
defines the way to parse the magic command |
Methods¶
method |
truncated documentation |
---|---|
Defines |
|
Documentation¶
Magic command to handle files
-
class
pyquickhelper.ipythonhelper.magic_class_diff.
MagicDiff
(**kwargs)[source]¶ Bases:
pyquickhelper.ipythonhelper.magic_class.MagicClassWithHelpers
Defines magic commands to visualize differences between files.
Create a configurable given a config config.
- configConfig
If this is empty, default values are used. If config is a
Config
instance, it will be used to configure the instance.- parentConfigurable instance, optional
The parent Configurable instance of this object.
Subclasses of Configurable must call the
__init__()
method ofConfigurable
before doing anything else and usingsuper()
:class MyConfigurable(Configurable): def __init__(self, config=None): super(MyConfigurable, self).__init__(config=config) # Then any other code you need to finish initialization.
This ensures that instances will be configured properly.
-
textdiff
(line)[source]¶ %textdiff
It displays differences between two text files, two strings, two urls, it is based on
create_visual_diff_through_html_files
. Check blog post Visualize differences between two files in a notebook to see an example. See also A magic command to visualize differences between two files in a notebook. The magic command is equivalent to:from IPython.core.display import display_html, display_javascript from pyquickhelper import docstring2html, create_visual_diff_through_html_files html, js = create_visual_diff_through_html_files(<f1>, <f2>, encoding=<encoding>, notebook=True, context_size=None if <context> in [None, ""] else int(<context>), inline_view=<inline>) display_html(html) display_javascript(js)