'how to append an entry with button in Tkinter

I tried to append entry text to a list with a button but after clicking on button the list still being empty.

from audioop import add
from html import entities
from lib2to3.pgen2 import driver
import time
from selenium import webdriver
from time import sleep
from selenium.webdriver.common import keys
from selenium.webdriver.common.keys import Keys
from re import M, sub
from decimal import Decimal
import random
from cProfile import label
from cgitb import text
from re import T
from tkinter import *
import tkinter as tk

from setuptools import Command
y = []
root = tk.Tk()
label = tk.Label(text="WhatsApp Spam" , foreground="white",background="black")
label.pack()
creator = tk.Label(text="creator : BlonDie", foreground="yellow",background="black")
creator.pack()
discreption = tk.Label(text="to use app : \n1: type your input \n2: open app \n3:login your whatsapp \n4: select your contact \n5: till you close this app it will send that massage")
discreption.pack()
def imp():
     input()
entry = tk.Entry(fg="white", bg="black", width=50 ).pack()
def btn1():
     y.append(entry)
tk.Button(text="start" , command=btn1).pack()


root.mainloop()


Solution 1:[1]

You have just call get() method on your entry:

def btn1():
    y.append(entry.get())

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 Sina Karimi