小编use*_*843的帖子

为什么在python子进程中没有正确传递十六进制数字

我无法使用python subprocess.Popen来插入模式...使用2.6.

测试:打开python解释器......

import subprocess
a = subprocess.Popen(['ping', '-c 1', '-p ff', '172.16.1.1'],subprocess.PIPE)
Run Code Online (Sandbox Code Playgroud)

结果... ping:模式必须指定为十六进制数字.

我已经将ff替换为:"f","23",23,0x23和一系列事物.我只是想看看shell认为它的结果.但是shell = True并没有像我预期的那样,a.communicate()给出(无,无)

python hex subprocess parameter-passing

1
推荐指数
1
解决办法
221
查看次数

极端新手 - 你好世界的错误

使用B. Stroustrup的编程文本和关于pg 50的'hello world'程序会产生错误.我有"std_lib_facilities.h"包含文件的问题.

运行后(以root身份)'gcc hworld1.cpp'输出为 -

In file included from /usr/include/c++/4.4/ext/hash_map:60,
             from std_lib_facilities.h:34,
             from hworld1.cpp:1:
/usr/include/c++/4.4/backward/backward_warning.h:28: warning: #warning This file     includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
/tmp/ccpwXUYx.o: In function `main':
hworld1.cpp:(.text+0x14): undefined reference to `std::cout'
hworld1.cpp:(.text+0x19): undefined reference to …
Run Code Online (Sandbox Code Playgroud)

c++

0
推荐指数
1
解决办法
916
查看次数

标签 统计

c++ ×1

hex ×1

parameter-passing ×1

python ×1

subprocess ×1