I'm currently trying to help a friend out with the same task that i have previously done, but im stuck. once the program is run and 'get tickets' is pressed this error message is displayed:
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Python34\lib\tkinter__init__.py", line 1533, in call return self.func(*args) File "C:\Users\harding\Documents\Oli\Homework\Year10\Computing\New folder\carpark 3.4 (1).py", line 21, in reg_output b.readlines(v.get()) TypeError: integer argument expected, got 'str'
code:
from tkinter import *
import time
root = Tk()
root.title('Car Park')
v = StringVar()
car_in=Label(root, text= "Please enter your reg number")
car_in.grid(column=1, row=1)
reg_input=Entry(root, textvariable =v)
reg_input.grid(column=1, row=2)
def reg_input():
with open ('tickets.txt', 'w') as b:
b.writelines(v.get())
def reg_output():
with open ('tickets.txt', 'r') as b:
b.readlines(v.get())
reg_input_but=Button(root, text='Submit', command=reg_input)
reg_input_but.grid(column=1, row=4)
reg_output_b=Button(root, text='Get Ticket', command=reg_output)
reg_output_b.grid(column=1, row=5)