.. _viewdifferencesrst: =================================================== View differences between two files, urls or strings =================================================== .. only:: html **Links:** :download:`notebook `, :downloadlink:`html `, :download:`PDF `, :download:`python `, :downloadlink:`slides `, :githublink:`GitHub|_doc/notebooks/view_differences.ipynb|*` *pyquickhelper* implements a function to visual differences between two strings, pyensae implements it as a magic command. .. code:: ipython3 import pyensae %load_ext pyquickhelper .. code:: ipython3 %textdiff -h .. parsed-literal:: usage: textdiff [-h] [-c CONTEXT] [-i] [-e ENCODING] f1 f2 show the differences between two files, two text positional arguments: f1 first file or text or url f2 second file or text or url optional arguments: -h, --help show this help message and exit -c CONTEXT, --context CONTEXT context view, empty to see everything, > 0 to see only a couple of lines around the changes -i, --inline True=one column (inline) or False=two columns -e ENCODING, --encoding ENCODING file encoding usage: textdiff [-h] [-c CONTEXT] [-i] [-e ENCODING] f1 f2 .. code:: ipython3 import os rep = os.path.join("..", "..", "src", "pyensae", "sql", "type_helpers.py") f2 = "https://raw.githubusercontent.com/sdpython/pyensae/master/src/pyensae/sql/type_helpers.py" %textdiff f2 rep -c 3 -i .. raw:: html
populating...
.. parsed-literal::