Discuss / Python / 【错误】AttributeError: 'module' object has no attribute 'call'

【错误】AttributeError: 'module' object has no attribute 'call'

Topic source

zhoufan879

#1 Created at ... [Delete] [Delete and Lock User]
import subprocess 

print ('$ nslookup www.baidu.com')

print ( dir(subprocess) )
# ['__builtins__', 
#  '__doc__', 
#  '__file__', 
#  '__name__', 
#  '__package__', 
#  'subprocess']
#

r = subprocess.run( ['nslookup', 'www.baidu.com'] )

print ('Exit code: ', r)

环境: Mac OS X (10.11) Python 3.5.0


  • 1

Reply