I am trying to make a multiple "page" GUI using tkinter and couldn't really find a good method. I resorted to using grid\_forget and seperating the "pages" in methods and it works like a charm. However I am trying to seperate the methods into a seperate file to make everything a little cleaner but I keep getting a global name error upon trying to run one of the methods with all of the widgets from my main file/class.

```
    Traceback (most recent call last):
  File "C:/Users/Derek/PycharmProjects/whites/Main.py", line 3, in <module>
    from screens import *
  File "C:\Users\Derek\PycharmProjects\whites\screens.py", line 4, in <module>
    import Main
  File "C:\Users\Derek\PycharmProjects\whites\Main.py", line 54, in <module>
    app = Application(master=main, w=main.winfo_width(), h=main.winfo_height())
  File "C:\Users\Derek\PycharmProjects\whites\Main.py", line 20, in __init__
    home_screen(self,True)
NameError: global name 'home_screen' is not defined

```

I also tried importing it such as `import screens` and tried to run `screens.home_screen(self,True)` and that yeilds

```
AttributeError: 'module' object has no attribute 'home_screen'

```

Even though it does

`Example Main.py`

```
from screens import *
import globals

class Application(tk.Frame):

    globals.init()

    def __init__(self, w, h, master=None):

        tk.Frame.__init__(self, master)
        self.grid()

        self.window_width = w
        self.window_height = h

        home_screen(self,True)
        query_screen(False)
        res_screen(False)
        settings_screen(False)

```

`screens.py`

```
import tkinter as tk
import globals
import Main

def home_screen(self, state):
     *define widgets for this "screen"

```

**[EDIT]**
Here is a copy of the full files.[screens](http://pastebin.com/v10rbynx) , [Main](http://pastebin.com/f7593NHg) , [globals](http://pastebin.com/K3F03Mnv)

**[EDIT: 2]**
So I changed the code around to try a different solution and it basically the same error. module object has no attribute if I attempt to convert the screens.py into a class and initialize it as an object but nothing. So I am guessing this means it is not python at all and more my project settings have somewhere gone askew