开发者

Python - Get build-id from an ELF file

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-readelf command 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜