file is deprecated in python 3, but open works on both. So for compatibility I would suggest to use open over file.