- 论坛徽章:
- 0
|
本帖最后由 月中井 于 2013-06-25 15:10 编辑
月中井 发表于 2013-06-25 09:36 ![]()
Traceback (most recent call last):
File "C:\Documents and Settings\Administrator\����\auto test\hello_test\ttttttt.py", line 45, in <module>
print m.read().split('\r\n')[1].split()[0]
AttributeError: 'Popen' object has no attribute 'read'
使用第三方的md5工具,做如下修改后,问题解决:
import os,sys
import subprocess
#from subprocess import Popen, PIPE, STDOUT
sAPP = 'e:\md5.exe'
sFile = 'D:\\python_sh\\test2.log'
m = subprocess.Popen(sAPP + " " + sFile,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
m_stdout = m.stdout.readlines()
print m_stdout[0].split()[0] |
|