Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Probably something along these lines:

with open('my_data.csv') as file:
    df = file.read()     
    print(df)

site with explaination and examples

The important bit is to use the with statement, because as that site explains, if you do it like that, python will automatically close the file for you when you're done with it. 

After opening the file and loading it's content into python, the next step would be to then fiddle with the data till it matches the format your program desires. It depends on how the data was saved and what it is. I find it helpful to first write code that saves the data and then after I've checked that it creates a file and that the file holds the testdata, then I write the code to load from a file to the game. You can use file.write or use a library like pickle.

So that would be:

with open('my_data.csv') as file: 
    file.write(yourData)

thank you very much! i try it for the next time