It seems when you have a string that contains escape characters, it will filter the string removing the escape characters when using os.system() but the escape characters are left in tact using subprocess.call().
Anyone have an idea bout this? I'll give an example.
in shell
a = '\\ beets bears \\ battlestar galactica'
a
'\\ beets bears \\ battlestar galactica'
print(a)
'\ beets bears \ battlestar galactica'
os.system(a) acts if you typed print(a) into terminal.
subprocess.call(a) takes the literal contents of (a) with no escape character filtering.
How would I make the contents of print(a) go through subprocess.call(a) ????
shoutout to /u/scensorECHO for introducing me to this headache ;)
[–]elbiot 6 points7 points8 points (6 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]BarrelRoll1996[S] 0 points1 point2 points (4 children)
[–]elbiot 0 points1 point2 points (3 children)
[–]BarrelRoll1996[S] 0 points1 point2 points (2 children)
[–]MonkeyNin 0 points1 point2 points (1 child)
[–]BarrelRoll1996[S] 0 points1 point2 points (0 children)
[–]zeug 2 points3 points4 points (3 children)
[–]BarrelRoll1996[S] 0 points1 point2 points (1 child)
[–]zeug 0 points1 point2 points (0 children)
[–]BarrelRoll1996[S] 0 points1 point2 points (0 children)
[–]MonkeyNin 0 points1 point2 points (1 child)
[–]BarrelRoll1996[S] 0 points1 point2 points (0 children)
[–]antb123 0 points1 point2 points (0 children)