I'm working on a Python script and I want to test to see if a DVD is in the drive.
I was planning on subprocess.Popen and just calling
but it seems that the grep isn't respected as the full ouput of the readcd command is returned.
But
returns what I expect, just the line with the CD-ROM info.
Any ideas?
I was planning on subprocess.Popen and just calling
Code:
readcd dev=2,0,0 | grep 'Sense Code:'
but it seems that the grep isn't respected as the full ouput of the readcd command is returned.
But
Code:
readcd -scanbus | grep 'CD-ROM'
returns what I expect, just the line with the CD-ROM info.
Any ideas?