Import objects from user input? (Python)

I am working on a game where the player can have multiple save games at once, and the player has to input the name of the savefile they want. How do I then convert their input into importing their chosen savefile?

You are viewing a single comment. View All

@19wintersp While this would work, the game gets saved as a .py file then imported later so the usual f = open will not work for this. Do you have any way to make something like

work? I tried this but it tries to import the name of the object rather than the object itself