[Tutor] Comparison Textboxes

bob gailer bgailer at gmail.com
Mon Aug 26 23:40:42 CEST 2013


On 8/26/2013 5:26 PM, taserian wrote:
> I'm attempting to gather the pieces I need for a simple project I'd 
> like to do for my job, but I'm having a difficult time finding 
> something, and I'm appealing to the hive mind at Tutor for wisdom.
>
> My project needs to compare two or more large textboxes (each one 
> containing a file or a large amount of text) and point out their 
> differences, establishing one textbox as the canonical one to which 
> the other textboxes are compared. This functionality is done in many 
> text editors (Notepad++ can install a plug-in that allows comparison 
> between two files), so I would think that the code behind this is 
> pretty common, yet I can't seem to find any reference to it. My 
> searches for "python text comparison code" points to Python IDEs that 
> include that functionality, but no indication as to how to include it 
> into my own code. I think I'm missing something else to search by, but 
> I can't determine what it is.
>
> Does anyone have an idea of what I'm talking about, and can you point 
> me in the right direction?
If you have diff available (e.g. on *nix) write a subprocess to pass the 
texts to diff and retrieve the results. There is NO need to re-invent 
the wheel.

-- 
Bob Gailer
919-636-4239
Chapel Hill NC



More information about the Tutor mailing list