I have this game I am working on. I am trying to use a config.py file for global variables like this.
from os import system clear_screen = system("cls") quit_game = exit(0)output:
Output:PS C:\Users\mcmxl>
I have also tried this. and get an attribute error.from os import system if __name__ == "__main__": clear_screen = system("cls") quit_game = exit(0)
Error:Guess a letter. Traceback (most recent call last):
File "c:/Users/mcmxl/mystuff/hangman/hangman.py", line 46, in main
guess_letter = input("Guess a letter. ")
KeyboardInterrupt
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:/Users/mcmxl/mystuff/hangman/hangman.py", line 112, in <module>
main()
File "c:/Users/mcmxl/mystuff/hangman/hangman.py", line 49, in main
config.clear_screen
AttributeError: module 'config' has no attribute 'clear_screen'
I don't know what else to do.