Timelapse python program