I'm trying to match ip address using ip address that i input myself and ip address that grep using os on python, but when i run my code, the code say not match
app = Tk()
app.title('IP Address')
app.geometry('250x150+200+200')
b = StringVar()
ip = os.popen("ip -4 addr show wlan0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'").read()
#this will insert wlan0 ip address to variable ip
print(ip)
def com():
c = b.get()
if c == ip:
labl3 = Label(text='Match').pack()
app.destroy()
else:
labl3 = Label(text='Not Match').pack()
labl1 = Label(text='Input Ip address',font=30).pack()
text = Entry(textvariable=b).pack()
button1 = Button(text='Press to print', command= com).pack()
app.mainloop()
how i fix this?