make loading a file work with both python2 and 3
make writing files work with python 2 and 3