use subprocess.check_output instead of the deprecated os.popen
a bit more pep8 compliant
Merge pull request #1 from evgeni/master

modern python is better