I am trying to set and get global variables from different files as
##config.py
def init():
global CELL_NUM_INROWS
CELL_NUM_INROWS = 10
##main.py
if __name__ == '__main__':
config.init()
######some codes here
g = Game(diff, dim, path)
g.start()
class Game:
def __init__(self, diff, dim, path):
config.CELL_NUM_INROWS = 20 ##eclipse putting red underline and saying undefined variable.
My code is working but I just wonder what is the problem here ? If I modify my variable inside the main it is not showing any red underlining. Thanks