add sys mode for bc
This commit is contained in:
parent
212d47b93f
commit
0997d2763b
1 changed files with 2 additions and 1 deletions
|
@ -366,7 +366,8 @@ def funMain (ch):
|
||||||
def sysbc (arg):
|
def sysbc (arg):
|
||||||
try:
|
try:
|
||||||
arg = arg.replace("\'", "")
|
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)
|
ret = subprocess.run(arg, shell = True, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, check = True, timeout = 1)
|
||||||
return bytes.decode(ret.stdout).replace("\n", "")
|
return bytes.decode(ret.stdout).replace("\n", "")
|
||||||
except subprocess.TimeoutExpired:
|
except subprocess.TimeoutExpired:
|
||||||
|
|
Loading…
Reference in a new issue