'Issue with tkinter being unable to open a window (Python + tkinter module)

I don't understand what the problem is with my code - it has everything i need and should execute fine.

No error is generated so I believe it is a logic error but I don't know how to fix it per say.

Help with this would be much appreciated.

from tkinter import *
from tkinter import ttk

def Payment_Computation(self):

 
def Getting_Payment_in_Monthly():


def __init__(self):



Solution 1:[1]

You are missing some vital parts of an oop program:

from tkinter import *
from tkinter import ttk

class MainApplication():   # create class

    def __init__(self):
        # method code

    def Payment_Computation(self):
        # method code
     
    def Getting_Payment_in_Monthly(self, Amount_Loan, mon_rate_interest, no_of_yrs):
        # method code

if __name__ == "__main__":
    MainApplication()    # Instantiate class

You need to place the code in a class. You then need to instantiate the class as exemplified above.

Read more about oop program structure in Best way to structure a tkinter application?

Solution 2:[2]

You didn't call the __init__() function. Please check carefully :)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 figbeam
Solution 2 Sun Podder