Я новичок в python и пытаюсь создать биллинговую систему, используя tkinter, но получаю эту ошибку
def showbillingsystem():
global tp
tp = Toplevel()
tp.geometry("890x580+0+0")
tp.title(" BILLING SYSTEM")
Tops = Frame(tp, bg="white", width=1600, height=50, relief=SUNKEN)
Tops.pack(side=TOP)
f1 = Frame(tp, width=900, height=700, relief=SUNKEN)
f1.pack(side=LEFT)
f2 = Frame(tp, width=400, height=700, relief=SUNKEN)
f2.pack(side=RIGHT)
# ------------------TIME--------------
localtime = time.asctime(time.localtime(time.time()))
# -----------------INFO TOP------------
rand = StringVar()
lblinfo = Label(Tops, font=('aria', 30, 'bold'), text=" BILLING SYSTEM", fg="Black", bd=10, anchor='w')
lblinfo.grid(row=0, column=0)
lblinfo = Label(Tops, font=('aria', 20,), text=localtime, fg="steel blue", anchor=W)
lblinfo.grid(row=1, column=0)
lblreference = Label(f1, font=('aria', 16, 'bold'), text="Order No.", fg="brown", bd=20, anchor='w')
lblreference.grid(row=0, column=0)
txtreference = Entry(f1, font=('ariel', 16, 'bold'), textvariable = rand, bd=6, insertwidth=6, bg="yellow",justify = RIGHT)
txtreference.grid(row=0, column=1)
Это сообщения об ошибках
File "C:/Users/rajat/PycharmProjects/untitled1/venv/MAINPROJECT.py", line 278, in showbillingsystem
txtreference = Entry(f1, font=('ariel', 16, 'bold'), textvariable = rand, bd=6, insertwidth=6, bg="yellow",justify = RIGHT)
File "C:\Users\rajat\AppData\Local\Programs\Python\Python37-32\lib\tkinter\__init__.py", line 2676, in __init__
Widget.__init__(self, master, 'entry', cnf, kw)
File "C:\Users\rajat\AppData\Local\Programs\Python\Python37-32\lib\tkinter\__init__.py", line 2299, in __init__
(widgetName, self._w) + extra + self._options(cnf))
File "C:\Users\rajat\AppData\Local\Programs\Python\Python37-32\lib\tkinter\__init__.py", line 341, in __str__
return self._name
AttributeError: 'StringVar' object has no attribute '_name'