getting data off a CDrom

Larry Bates larry.bates at websafe.com
Mon Dec 5 09:44:35 EST 2005


julien.lord at gmail.com wrote:
> Hi there,
> 
> I'm trying to load data from 2 different CD drives to compare the data
> on them to see if they are identical.  I've found the WinCDRom module
> online but it doesn't seem to give access to the data at all. The only
> thing it seems to do is check if there is a readable cd in a specific
> drive.
> 
> Any ideas/suggestions/flames?
> 
> Thanks,
> 
> Julien
> 
The two CDROMs should show up with drive letters attached (Windows) on
your machine.  Just open the files on both machines as you would any other
file:

fp1=open(r'D:\filename1', 'r')
fp2=open(r'E:\filename2', 'r')

You could:

1) use md5 to calculate checksums on both files and compare

or

2) you could use difflib instead see:

http://docs.python.org/lib/module-difflib.html

difflib probably works best if the files are text files.

3) do something custom to compare the files, but I would
try 1) and 2) first.

Larry Bates



More information about the Python-list mailing list