我的代码是: #!/usr/bin/python
## print linux os command output
import os
p = os.popen ('fortune | cowsay',"r")
while 1:
line = p.readline()
if not line: break
print line
retvalue =
我想从os.system("nslookup google.com")得到输出,但是在打印时总是得到0。为什么是这样的,我该如何解决这个问题? (Python 3中,苹果机) (我看着How to store the return value of os.system that it has printed to stdout in python? - 但是我不明白吧〜我是新来的Python)
在蟒蛇3.4,我试图打开在Linux中使用VLC一个“WAV”文件。这里是我的代码: import os,time
os.system("cvlc audio/some.wav")
time.sleep(3) #audio was one and half sec
a = 3+3
print (a)
它播放的音频,但其余不做。我该怎么做才能做到这一点?更确切地说,我应该怎样做才能关闭