How to find a settings.py

Question:
Hey. Trying to make a zelda style game and i need to find out how to add a setting.py to my main.py. Can anyone help me, please and thank you.

Replit Profile: https://replit.com/@BenjaminWilli34

Hi @BenjaminWilli34 , welcome to the forums!
You can first create a file called settings.py. Go to the 3 dots in the Files sidebar, then press Create File. Then, call it settings.py.
To connect settings.py with main.py, at the top of main.py, add the line import settings. Then, access functions or classes or whatnot of settings.py by using settings.function() in main.py to use the appropriate functions.
Hope this helps!


Example:
settings.py:

def display(text):
  print(text)

main.py:

import settings
# Other code here...
settings.display('Hello, World!') # Using the settings file's function
3 Likes