comparison data python 2.7

This is the place for queries that don't fit in any of the other categories.

comparison data python 2.7

Postby kostas89 » Fri May 23, 2014 12:15 pm

I would like to ask if there is an possibility to take from this method only the different directories/files without all the Identical files and the Common subdirectories. Could you give me an idea how to modify it? As beginner I didnt think that I could. So I wrote a code for the comparison of data, using the hashlib (sha1) but now I change my mind and I think that I can trust this method if I am able to take the desired results.
Code: Select all
comparison = filecmp.dircmp(original,copy)
Posts: 2
Joined: Fri May 23, 2014 12:13 pm

Re: comparison data python 2.7

Postby stranac » Fri May 23, 2014 12:59 pm

Not with that method, no.

You can take a look at the filecmp.dircmp source to see how it does things.
Once you do that, it should be very simple to write a function that prints just the data you want.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
Posts: 1790
Joined: Thu Feb 07, 2013 3:42 pm

Return to General Coding Help

Who is online

Users browsing this forum: Bing [Bot] and 10 guests