I’m making a text-based game, and I just finished the majority of code, and now the only thing I have to write is game content.
However, what I have now is mostly broken. Everytime I run this file with these four files: this, this, and this file, it crashes when I enter ‘play’ or ‘story’ it gives “NameError: Global name ‘gameF’ not defined” and “NameError: Global name ‘storyF’ not defined”, respectively.
I have tried Googling ‘Global name’ and ‘NameError’, but I found nothing useful or that I could understand.
Import the function from the file where it was defined. If
gameF()is defined in my_file.py, you just need to do: