How to link hr_operating_units and hz_cust_acct_sites_all in oracle

Solution:-
The hr_operating_units table having the unique column that is ORGANIZATION_ID and hz_cust_acct_sites_all having the column ORG_ID which is used to join the hr_operating_units for getting customer operating_unit or getting customer details.

Example:-

select hou.name operating_unit,hcas.cust_acct_id
from hr_operating_units hou,hz_cust_acct_sites_all hcas
where hou.ORGANIZATION_ID=hcas.ORG_ID
Share:

AttributeError: 'NoneType' object has no attribute 'get'

Sample program:

import tkinter as tk
master = tk.Tk()
tk.Label(master, text="First Number").grid(row=0, column=0)
tk.Label(master, text="Second Number").grid(row=1, column=0)
tk.Label(master, text="Value").grid(row=2, column=0)
# Display entry fields
e1 = tk.Entry(master).grid(row=0, column=1) 
e2 = tk.Entry(master).grid(row=1, column=1)
def display():
            a=int(e1.get())
            b=int(e2.get())
            tot=a=b
            tk.Label(master, text=str(tot)).grid(row=2, column=1)       
# end of display function
# button to display all the calculated total 
button1=tk.Button(master, text="Submit", bg="green", command=display)
button1.grid(row=6, column=1)
master.mainloop()

    Output:
    Error:
    1. Exception in Tkinter callback
      Traceback (most recent call last):
        File "C:\Users\KUMAR\AppData\Local\Programs\Python\Python38-32\lib\tkinter\__init__.py", line 1883,
       in __call__
          return self.func(*args)
        File "C:/Users/KUMAR/AppData/Local/Programs/Python/Python38-32/myprgm/rough.py", line 10,
       in display
          a=int(e1.get())
      AttributeError: 'NoneType' object has no attribute 'get'.

    Problem:
    •  None Type means, You got no value. It means an assignment or function call up failed.
    Solution:
    •  If the entry field contains some calculation, then entry field declaration and place value must be separate.

    e1 = tk.Entry(master)
    e2 = tk.Entry(master)
    e1.grid(row=0, column=1) 
    e2.grid(row=1, column=1) 

    Share:

    Python GUI

    Python Tkinter
    Tkinter is Python’s standard GUI package. When combined python with Tkinter provides a fast and easy way to create GUI applications. Tkinter provides a powerful object-oriented interface to the Tk GUI toolkit.

    Syntax:

     import tkinter as short_name
     variable_name = alise_name.Tk()  
     variable_name.title("Title")
     variable_name.mainloop()  
      Example

      import tkinter as tk
      T= tk.Tk() 
      T.title("tk"
      T.mainloop()  
        Output:

        Tkinter widgets

        1.Label:

        The Label is used to display a text or image.

        Syntax:

        tk.Label(tkinter_variable_name,options)

        2.Entry:

        The Entry is used to type a text.

        Syntax:

        tk.Entry(tkinter_variable_name,options)

        3.Button:

        The Button widget is used to trigger any actions. These actions can be navigating to another form, interaction with the dialog box, perform display operations, etc. 

        Syntax:

        tk.Button(tkinter_variable_name,options)

        Tkinter Geometry


        The Tkinter geometry is used to displaying widgets like button, list, Checkbox and so on. If set Tkinter size using geometry method : 

        Syntax:

             tkinter_variable_name.geometry("widh x hight")

        Example:
             
             T.geometry("100x100")

        1. pack() method:

        1. A pack() is used for displaying labels,buttons,etc in Tkinter.
        2. Options: Side='left', Side='right', Side='bottom',Side='top'.
        3. The default pack method aligns in the center.
        Syntax:
        widget_variable_name.pack(options)
        Example:   
         L.pack(Side='RIGHT')
         B.pack()

        Example Program:
        import tkinter as tk
        T= tk.Tk()  
        B1 =tk.Button(T, text = "Addition", fg = "red")  
        B1.pack( side = 'left')  

        B2=tk. Button(T, text = "Subtraction", fg = "black" 
        B2.pack( side ='right')
          
        B3=tk. Button(T, text = "Multiplication", fg = "blue" 
        B3.pack( side = 'top')  

        B4=tk. Button(T, text = "Division", fg = "green")  
        B4.pack( side = 'bottom'

        T.mainloop()  
          Output:

          2. grid() method:

          The grid() method organizes the widgets in the tabular form. We can specify the rows and columns as the options in the method call.
          Syntax:
          widget_variable_name.grid(row=value,column=value)
          Example:
          L.grid(row=0,column=0)
          Example Program:
          import tkinter as tk

          T = tk.Tk()  


          tk.Label(T,text = "Name").grid(row = 0, column = 0)  


          e1 =tk.Entry(T)


          e1.grid(row = 0, column = 1)  


          tk.Label(T,text = "Password").grid(row = 1, column = 0)  


          e2 = tk.Entry(T)


          e2.grid(row = 1, column = 1)  


          b= tk.Button(T, text = "Submit").grid(row = 4, column = 0)  



          T.mainloop()  

            Output:








            Output Explanation:

            3.place() method
            The place() geometry manager organizes the widgets to the specific x and y coordinates.
            Syntax:
            widget_variable_name.place(x=value,y=value)
            Example:
            L.place(x=30,y=50)
            Example Program:
            import tkinter as tk
            T =tk.Tk()  
            T.geometry("400x250")  

            l1 = tk.Label(text = "Student Roll No").place(x = 30,y = 50)  
            l2 = tk.Label(text = "Student name").place(x = 30, y = 90 
            l3 = tk.Label(T, text = "Student age").place(x = 30, y = 130)  

            e1 = tk.Entry(T).place(x = 120, y = 50)  
            e2 = tk.Entry(T).place(x = 120, y = 90)  
            e3 = tk.Entry(T).place(x = 120, y = 130)  

            T.mainloop()  
              Output:


              Output Explanation:

              Example for label,button and entry widgets:

              import tkinter as tk 
              T = tk.Tk()
              # display lables 
              tk.Label(T, text="First number").grid(row=0, column=0) 
              tk.Label(T, text="Second Number").grid(row=1, column=0)
              tk.Label(T, text="Result").grid(row=2, column=0)
              # Display entry fields
              e1 = tk.Entry(T)  
              e2 = tk.Entry(T) e1.grid(row=0, column=1)
              e2.grid(row=1, column=1)
              def display(): 
                  a=int(e1.get())
                  b=int(e2.get())
                  tot=a+b
                  tk.Label(T, text=str(tot)).grid(row=2, column=1)
              # end of display function 
              # button to display 
              button1=tk.Button(T, text="Add", bg="green", command=display) 
              button1.grid(row=5, column=1) 
              T.mainloop()  
                Output:
                Output Explanation:

                4.CheckBox:
                The Checkbox widget is used to generate a click event for the Select or choose in the lists
                Example:

                import tkinter as tk
                T = tk.Tk()
                T.geometry('300x300')
                #display label 
                l = tk.Label(T, bg='white', width=50, text='Choose wanted course')
                l.pack()
                def selection():
                    if (var1.get() == 1) & (var2.get() == 0):
                        l.config(text='You are choosed Python course')
                    elif (var1.get() == 0) & (var2.get() == 1):
                        l.config(text='You are choosed Java course')
                    elif (var1.get() == 0) & (var2.get() == 0):
                        l.config(text='I do not want anything')
                    else:        
                        l.config(text='You are choosed both')
                #display checkbox 
                var1 = tk.IntVar()
                var2 = tk.IntVar()
                c1 = tk.Checkbutton(T, text='Python',variable=var1, onvalue=1, offvalue=0,
                command=selection)
                c1.pack()
                c2 = tk.Checkbutton(T, text='Java',variable=var2, onvalue=1, offvalue=0,
                command=selection)
                c2.pack()
                T.mainloop()

                Program Explanations:
                Step1: Import tkinter
                Step2: Set label
                Step3: Definitions of function Step4: IntVar()
                The IntVar() function used to assign initial values for checkbox ,i.e. off and on operation. So this function contains two values. Zero and One (0 and 1).
                Step5: Display Checkbox
                Output:

                Output Explanation:
                4.Radio Button:

                The Radio button widget is used to select a single item from a predefined list of options
                Example:

                import tkinter as tk
                T = tk.Tk()
                T.geometry("300x150")
                l1 = tk.Label(text = "Select your gender")  
                l1.pack()
                Var1 = tk.IntVar() 
                def selection():  
                   selection = "You selected the option " + str(Var1.get())  
                   l2.config(text = selection)
                R1 = tk.Radiobutton(T, text="Male", variable=Var1, value=1,  
                                  command=selection)  
                R1.pack( anchor = 'w' )  
                R2 = tk.Radiobutton(T, text="Female", variable=Var1, value=2,  
                                  command=selection)  
                R2.pack( anchor = 'w' )    
                R3 = tk.Radiobutton(T, text="Others", variable=Var1, value=3,  
                                  command=selection)  
                R3.pack( anchor = 'w')  
                l2 = tk.Label(T)  
                l2.pack()  
                T.mainloop()  

                Output:

                Share:

                Student Marks details using Tkinter in Python

                Python - Create a Simple mark sheet using GUI(Tkinter)

                • Tkinter is Python’s standard GUI package.
                •  When combined python with Tkinter provides a fast and easy way to create GUI applications.
                • Tkinter provides a powerful object-oriented interface to the Tk GUI toolkit.
                • For examle, Get the Student details from the user and generate automatic values for total and average using Python Tkinter(GUI).
                • Generate automatic values for total and average using Python Tkinter(GUI). 

                 Example program:

                1. import tkinter as tk
                  master = tk.Tk()
                  master.title("MARKSHEET")
                  master.geometry("700x250")
                  # display lables
                  tk.Label(master, text="Name").grid(row=0, column=0)
                  tk.Label(master, text="Reg.No").grid(row=0, column=3)
                  tk.Label(master, text="Roll.No").grid(row=1, column=0)
                  tk.Label(master, text="Srl.No").grid(row=2, column=0)
                  tk.Label(master, text="1").grid(row=3, column=0)
                  tk.Label(master, text="2").grid(row=4, column=0)
                  tk.Label(master, text="3").grid(row=5, column=0)
                  tk.Label(master, text="4").grid(row=6, column=0)
                  tk.Label(master, text="5").grid(row=7, column=0)
                  tk.Label(master, text="Subject").grid(row=2, column=1)
                  tk.Label(master, text="Tamil").grid(row=3, column=1)
                  tk.Label(master, text="Englih").grid(row=4, column=1)
                  tk.Label(master, text="Maths").grid(row=5, column=1)
                  tk.Label(master, text="Science").grid(row=6, column=1)
                  tk.Label(master, text="Social").grid(row=7, column=1)
                  tk.Label(master, text="Marks").grid(row=2, column=2)
                  tk.Label(master, text="Total").grid(row=7, column=3)
                  tk.Label(master, text="Average").grid(row=8, column=3)
                  # Display entry fields
                  e1 = tk.Entry(master)
                  e2 = tk.Entry(master)
                  e3 = tk.Entry(master)
                  e4 = tk.Entry(master)
                  e5 = tk.Entry(master)
                  e6 = tk.Entry(master)
                  e7 = tk.Entry(master)
                  e8 = tk.Entry(master)
                  e1.grid(row=0, column=1)
                  e2.grid(row=0, column=4)
                  e3.grid(row=1, column=1)
                  e4.grid(row=3, column=2)
                  e5.grid(row=4, column=2)
                  e6.grid(row=5, column=2)
                  e7.grid(row=6, column=2)
                  e8.grid(row=7, column=2)
                  def display():
                              t=int(e4.get())
                              e=int(e5.get())
                              m=int(e6.get())
                              s=int(e7.get())
                              ss=int(e8.get())
                              tot=t+e+m+s+ss
                              avg=tot/5
                              # to display total
                              tk.Label(master, text=str(tot)).grid(row=7, column=4)
                              # to display AVG
                              tk.Label(master, text=str(avg)).grid(row=8, column=4)       
                  # end of display function
                  # button to display all the calculated total scores and avg
                  button1=tk.Button(master, text="Submit", bg="green", command=display)
                  button1.grid(row=8, column=1)
                  master.mainloop()
                Output:

                Share:

                Recent Posts

                Service Support

                Need our help to Learn or Post New Concepts Contact me