I’m trying to extract the build-id from and ELF file (Linux kernel module).
Right now it’s using:
subprocess.check_output(['eu-readelf', '-n', filename]).split()[-1]
I was wondering is there’s a more pythony way to achieve the same result?
Thanks, Alex.
Calling the
eu-readelfcommand from python, as you have done, is the most elegant and readable approach. Since python stresses readability, I’d say this is the most Pythonic approach.