Python中"readelf -h Demo.elf"与"python readelf.py -h Demo.elf"命令的区别是什么?
在 D:\Python27\Scripts 目录下有个脚本文件 readelf.py
使用"readelf -h Demo.elf"直接执行时脚本得到的参数 sys.argv 中只有文件名,后面两个参数-h 和 Demo.elf 都没有
通过"python readelf.py -h Demo.elf"执行时脚本可以得到三个参数
请问这正常吗??为什么会这样子??能够解决让"readelf -h Demo.elf"时脚本程序也能得到参数吗??
Python中"readelf -h Demo.elf"与"python readelf.py -h Demo.elf"命令的区别是什么?
4 回复
正常。没办法,因为 exec 应该不是一样的吧
我无法理解你的问题。
Windows 吗?修改注册表中*.py 的文件关联试试
https://stackoverflow.com/questions/29540541/executable-python-script-not-take-sys-argv-in-windows
多谢,确实是这个问题,,

