Unix diff command under Window.

T

TonyHa

Hello,

Does any one have using Python to write a Unix "diff" command for
Window?

Tony Ha.
 
T

Thomas Heller

TonyHa said:
Hello,

Does any one have using Python to write a Unix "diff" command for
Window?

Tony Ha.

Yes. There's a script in your Python distribution:
Tools/scripts/diff.py

See also the docs for the 'difflib' standard library module.

I do not know whether the Tools directory is installed by default or
not.

Thomas
 
J

jepler

Either it didn't exist at the time, or I didn't know about the diff.py that
Thomas Heller mentioned in another response, so I wrote 'pyunidiff'
http://unpy.net/~jepler/pyunidiff.py

ah, I guess unix 'diff'-style output was added to difflib.py in 2003, while my
pyunidiff dates to 2002.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQFDDJKvJd01MZaTXX0RAjcgAJ9R8HpvQIx68iZuvZ/KX7mQbe7umQCfW/di
WrFitVHsLGAmmifxcGiMUeQ=
=v/US
-----END PGP SIGNATURE-----
 
N

Neil Hodgson

Thomas Heller:
Yes. There's a script in your Python distribution:
Tools/scripts/diff.py

See also the docs for the 'difflib' standard library module.

Is the opposite code, a Python equivalent to 'patch' available? I
have endless trouble receiving patch files that assume one of Windows or
Unix (in terms of path names and line end characters) which then fail to
apply on the other platform. I would like to have a version I could hack on.

Neil
 
T

Trent Mick

[Neil Hodgson wrote]
Thomas Heller:


Is the opposite code, a Python equivalent to 'patch' available? I
have endless trouble receiving patch files that assume one of Windows or
Unix (in terms of path names and line end characters) which then fail to
apply on the other platform. I would like to have a version I could hack on.

So would I! I also have problems with the available patch.exe binaries
hanging or crashing occassionally on Windows.

Trent
 
M

Max M

TonyHa said:
Hello,

Does any one have using Python to write a Unix "diff" command for
Window?


I generally just us the diff built into tortoiseSVN. That way it's only
a rightclick away.


--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science
 
T

Thomas Heller

Trent Mick said:
[Neil Hodgson wrote]
Thomas Heller:


Is the opposite code, a Python equivalent to 'patch' available? I
have endless trouble receiving patch files that assume one of Windows or
Unix (in terms of path names and line end characters) which then fail to
apply on the other platform. I would like to have a version I could hack on.

So would I! I also have problems with the available patch.exe binaries
hanging or crashing occassionally on Windows.

The only slightly related thing that I know of is the 'Perl Power Tools'
Unix reconstruction project. Seems they have a 'patch' command
implemented in perl:

http://ppt.perl.org/commands/patch/

Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top