Python SQLite TypeError
Question: 
    from sqlite3 import *
    
    def insert_record(Who, Invented):
    
        connection = connect(database = "activity.db")
    
        internet = connection.cursor()
    
        list = "INSERT INTO Information VALUES((Alexander_Graham, Phone))"
    
        internet.execute(list)
    
        rows_inserted = internet.rowcount
    
        connection.commit()
    
        internet.close()
        connection.close()
    
    #GUI interface
    from Tkinter import *
    window = Tk()
    
    the_button3 = Button(window, text='Record', command = insert_record).grid(row=1, sticky=W, padx=100,pady=5)
    window.mainloop()
    

Alright, so what I'm trying to do is when I press the Record button, the
values for Information (it have 2 fields called Who and Invented,
respectively) in activity.db will add a record Alexander_Graham and Phone.

*activity.db is already premade in the same folder as the code

But instead I get this error: TypeError: insert_record() takes exactly 2
arguments (0 given)

How do I fix it?


Answer: insert record is a function that takes two required arguments, which you
didn't pass values in for.

    
    
    command = insert_record
    

A good example of this in action is the following test sequence:

    
    
    In [1]: def func(one,two):
       ...:     return one+two
       ...: 
    
    In [2]: func()
    -------------------------------------------------------------------------    --
    TypeError                                 Traceback (most recent call     last)
    <ipython-input-2-08a2da4138f6> in <module>()
    ----> 1 func()
    
    TypeError: func() takes exactly 2 arguments (0 given)
    
    In [3]: func(1,3)
    Out[3]: 4
    

In this function, it fails in the same was as your tk app. You need to provide
a function that has default values, or handle it a different way.

