Executing commands in python