I'm working on a text-based adventure game, and this code searches through a room file and pulls a substring from it that adds it to a list of enemies.
with y.index("~") as _0:
self.room_enemies.append(y[_0:_0])
print(y[_0:_0])
However, when I run it, it gives me this:
AttributeError: __enter__
If this isn't enough information for a good answer, please let me know.