Python Forum

Full Version: how to write and read variables to a file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I googled around to see how i can write a variable lets say the string name,which equals "john"to a file and then when i reopen the script i can read te file and set name=john.as im making a simple text game and want to savw character name health and damage(upgradable) ans be able to load later.i couldn't find anything useful(zo me atleast as im still new )sorry if ita obvious or im dumb and cant understand it.thanks in advance!
Have you taken a look at JSON?
Just use pickle