From 0997d2763b39a2933ea6b7c60573e369cb60b843 Mon Sep 17 00:00:00 2001 From: weilinfox Date: Wed, 11 Mar 2020 18:16:42 +0800 Subject: [PATCH] add sys mode for bc --- worker/bc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/worker/bc.py b/worker/bc.py index f20b9ab..bf5f3ec 100644 --- a/worker/bc.py +++ b/worker/bc.py @@ -366,7 +366,8 @@ def funMain (ch): def sysbc (arg): try: arg = arg.replace("\'", "") - arg = "echo \'\'\'" + arg + "\'\'\' | bc" + arg = "echo '''" + arg + "''' | bc" + #print(arg) ret = subprocess.run(arg, shell = True, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, check = True, timeout = 1) return bytes.decode(ret.stdout).replace("\n", "") except subprocess.TimeoutExpired: