I am coding a program where I am using curses to create a UI and I have gotten the width and height of the terminal via a different command and I want to make those two variables global so that I can refer to them throughout the program without having to pass them in through parameters everytime (unless I should just do that?) here is a simple layout of the series of calls I have:
def three():
print width, height
def two():
three()
def one():
two()
global width
global height
width, height = console.getTerminalSize()
one()
So I am getting the global name not defined error but not sure why as I have defined them as global first then called the series of functions, where did I go wrong?