Motion detection script with Python