For a school project I am making a hangman game in Python. Right now my code picks a word from a dictionary like so:
WordList = [\"cat\", \"hat\", \"jump\",
If you exit the code you stop the process. For this reason you lose all data. You have to add the words keeping the script alive. The suggestion is to use a server that processing all your calls (example: http://flask.pocoo.org/) or to use the python command input (https://en.wikibooks.org/wiki/Python_Programming/Input_and_Output).
But remember... if you stop the process you lose all data, it is normal.
Otherwise, before stopping your script, you have to save all the data into a file or database and load them when the script starts.