@classmethod
    def from_filename(cls, filename):
        assert filename.endswith('.p8.png') or filename.endswith('.p8')
        if filename.endswith('.p8'):
            with open(filename, 'r', encoding='utf-8') as fh:
                g = Game.from_p8_file(fh, filename=filename)
        else:
            with open(filename, 'rb') as fh:
                g = Game.from_p8png_file(fh, filename=filename)
        return g
Loads a game from a named file.
dataset/ETHPy150Open dansanderson/picotool/pico8/game/game.py/Game.from_filename