Processing commands with Python