V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
XIVN1987
V2EX  ›  Python

"readelf -h Demo.elf"与" Python readelf.py -h Demo.elf"的区别

  •  
  •   XIVN1987 · 2018-06-28 17:28:47 +08:00 · 2048 次点击
    这是一个创建于 2122 天前的主题,其中的信息可能已经有所发展或是发生改变。

    在 D:\Python27\Scripts 目录下有个脚本文件 readelf.py

    使用"readelf -h Demo.elf"直接执行时脚本得到的参数 sys.argv 中只有文件名,后面两个参数-h 和 Demo.elf 都没有

    通过"python readelf.py -h Demo.elf"执行时脚本可以得到三个参数

    请问这正常吗??为什么会这样子??能够解决让"readelf -h Demo.elf"时脚本程序也能得到参数吗??

    3 条回复    2018-06-29 09:27:43 +08:00
    lance6716
        1
    lance6716  
       2018-06-28 20:44:50 +08:00 via Android
    正常。没办法,因为 exec 应该不是一样的吧
    nyanyh
        2
    nyanyh  
       2018-06-28 20:47:15 +08:00   ❤️ 1
    XIVN1987
        3
    XIVN1987  
    OP
       2018-06-29 09:27:43 +08:00
    @nyanyh
    多谢,确实是这个问题,,
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2273 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 00:52 · PVG 08:52 · LAX 17:52 · JFK 20:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.