diff options
| author | Peng Wu <alexepico@gmail.com> | 2011-07-18 17:36:39 +0800 |
|---|---|---|
| committer | Peng Wu <alexepico@gmail.com> | 2011-07-18 17:36:39 +0800 |
| commit | 1b363860cb617c3d4b2294250eecf8163577336e (patch) | |
| tree | 0b3df956b4596d037ff48859b18cbac1d2fa027d | |
| parent | c60c7a70e1af20ee46f57817137df980b6392133 (diff) | |
| download | trainer-1b363860cb617c3d4b2294250eecf8163577336e.tar.gz trainer-1b363860cb617c3d4b2294250eecf8163577336e.tar.xz trainer-1b363860cb617c3d4b2294250eecf8163577336e.zip | |
refine report file in segment.py
| -rwxr-xr-x | segment.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -29,11 +29,11 @@ def segmentOneText(infile, outfile, reportfile): subprocess = Popen(cmdline, shell=True, stderr=PIPE, \ close_fds=True) - data = ''.join(subprocess.stderr.readlines()) - if data: + lines = subprocess.stderr.readlines() + if lines: print('found error report') with open(reportfile, 'wb') as f: - f.writelines([data]) + f.writelines(lines) f.close() os.waitpid(subprocess.pid, 0) |
