subprocess wildcard usage

import os import subprocess proc = subprocess.Popen(['ls','*.bc'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out,err = proc.communicate() print out This script should print all the files with .bc suffix however it returns an empty list. If I do ls *.bc manually in the command line it works. Doing [‘ls’,’test.bc’] inside the script works as well but for some reason the … Read more

Python subprocess.call a bash alias

At work there’s a script that lists completed tasks. This was written by someone else and is hosted over the network. I have an alias in my .bashrc that calls this script, with its many flags and such, and I wanted to write a python script that would call this alias every few minutes so I can have a shell open with updated stats. However, subprocess.call("myAlias") fails. I’m still fairly new to python, and am struggling to figure this out.