@@ -171,9 +171,12 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
171
171
expressed in the ISO 8601 format. If not specified, the
172
172
strings default to blanks.
173
173
174
+ >>> import sys
175
+ >>> from difflib import *
174
176
>>> s1 = [' bacon\n ' , ' eggs\n ' , ' ham\n ' , ' guido\n ' ]
175
177
>>> s2 = [' python\n ' , ' eggy\n ' , ' hamster\n ' , ' guido\n ' ]
176
- >>> sys.stdout.writelines(context_diff(s1, s2, fromfile = ' before.py' , tofile = ' after.py' ))
178
+ >>> sys.stdout.writelines(context_diff(s1, s2, fromfile = ' before.py' ,
179
+ ... tofile= ' after.py' ))
177
180
*** before.py
178
181
--- after.py
179
182
***************
@@ -294,13 +297,12 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
294
297
For inputs that do not have trailing newlines, set the *lineterm * argument to
295
298
``"" `` so that the output will be uniformly newline free.
296
299
297
- The context diff format normally has a header for filenames and modification
300
+ The unified diff format normally has a header for filenames and modification
298
301
times. Any or all of these may be specified using strings for *fromfile *,
299
302
*tofile *, *fromfiledate *, and *tofiledate *. The modification times are normally
300
303
expressed in the ISO 8601 format. If not specified, the
301
304
strings default to blanks.
302
305
303
-
304
306
>>> s1 = [' bacon\n ' , ' eggs\n ' , ' ham\n ' , ' guido\n ' ]
305
307
>>> s2 = [' python\n ' , ' eggy\n ' , ' hamster\n ' , ' guido\n ' ]
306
308
>>> sys.stdout.writelines(unified_diff(s1, s2, fromfile = ' before.py' , tofile = ' after.py' ))
0 commit comments