Run BASH built-in commands in Python? -


I tried:

Is the built command of BSH can be run with Python ? / P>

  subprocess.Popen (['bash', 'history'], shell = true, stdout = PIPE) subprocene. Popin ('history', shell = true, executable = "/ bin / bash", Stdout = subprocess.PIPE) os.system ('history')   

and its many variations I would like to turn on history or fc -ln

I have finally found a solution that works.

  pop-up, pipe, STDOUT open_ command = 'Bash-E-C' history -R; History '' event = popon Shell_command, shell = true, stdin = PIPE, stdout = PIPE, stderr = STDOUT) output = event.communicate ()   

Thank you all for the input.

Comments