From 3fa6f5a7c5807dabf73090bc3f4e51219807777e Mon Sep 17 00:00:00 2001 From: wenqiurong Date: Wed, 15 Jan 2020 15:13:37 +0800 Subject: [PATCH] adjust --- video.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/video.py b/video.py index 2cdefcd..e61842f 100644 --- a/video.py +++ b/video.py @@ -37,10 +37,11 @@ def convert(origin, target): answer = 'Overwrite ? [y/N]' try: outs, errs = proc.communicate(timeout=300) - print(outs, errs) - if answer in outs: - proc.stdin.write(b'y') - if proc.returncode == 0: + ret_info = str(outs, encoding='utf-8') + print(ret_info, errs) + if answer in ret_info: + proc.stdin.write(b'y') + elif proc.returncode == 0: print("{0} convert {1} Success, origin dat will remove!".format(origin, target)) os.remove(origin) else: