I need to execute 

```
grep 'ERROR:A:\|ERROR:B:\|ERROR:C:\|RESOLVED:A:\|RESOLVED:B:\|RESOLVED:C:' /HOME/SOME_LOCATION/FILENAME

```

This works fine in shell, but I need to excute it from my python script.
So in the python script I do

```
filename = "/HOME/SOME_LOCATION/FILENAME"
cmd = 'grep \'ERROR:A:\|ERROR:B:\|ERROR:C:\|RESOLVED:A:\|RESOLVED:B:\|RESOLVED:C:\' '+filename+''

```

But if I give it to 

```
commands.getstatusoutput(cmd)

```

it gives error

```
     commands.getstatusoutput(cmd)
  File "<stdin>", line 1
    commands.getstatusoutput(cmd)
    ^
IndentationError: unexpected indent

```

I tried to find what cmd had, strangely it was

```
>"grep 'ERROR:A:\\|ERROR:B:\\|ERROR:C:\\|RESOLVED:A:\\|RESOLVED:B:\\|RESOLVED:C: /HOME/SOME_LOCATION/FILENAME"

```

1. Now it puts 2 Esc sequence backslashes, which I dont understand why. Also , I'm assuming this to be the reason why commands.getstatusoutput did not work.

Is there any way to make this command work.

This is just a part of my bigger objective, I also need to use get a count of matching strings using grep -c, check it with previous grep count (which I would save in some variable) and using the difference, print last such lines. eg. if grep -c 'exp' file gives 15 and the previous count was 10 (meaning 5 new entries have been appended) I need to print those 5. However I'm currently stuck at the beginning itself.

Python 2.5