command = ['egrep', '-r']
for e in excludes:
    command.append('--exclude=*%s*' % e)
command += ['text', '~/directory']
subprocess.Popen(command, stdout=subprocess.PIPE).communicate()[0]
Python subprocess to Bash: curly braces