Show us your actual code. Make sure you call exec on the same variable as the one you initialize in line #4 of what you posted. Note that I mean the same variable, not variable with the same name.