Using open() instead of file() for python 3+