Python scripts that work with files can look simple until something goes wrong. Your script may read the correct file during class, then fail when a filename contains a space ...