Home > other >  How to call other functions python3.7 tkinter inside of the button
How to call other functions python3.7 tkinter inside of the button

Time:11-01

I'm doing a background call chrome software for telecom network automatic login now card in the block button GUI is probably a certain button and a Label to input box box is intercept verification code to the left of the password is the first not to write in software, first I want to click confirm button to send the value of the Label to the telecommunication network verification code in the box and then click login button that steps can be implemented but the problem is that I don't close behind tkinter window detection Alert window's code is not run and I want to get is if detected Alert pop-up window will enter the code back to the steps I novice, strives for the bosses know appreciate! The following is a part of the problem code
The from PIL import Image
The import tkinter. Messagebox
Im2=Image. Open (" cut_image. PNG ")
Img2=ImageTk. PhotoImage (im2)
L2=Label (root, image=img2)
L2. Pack (side=LEFT)
V1=StringVar ()
E1=Entry (root, textvariable=v1, bd=5)
E1. Pack (side=RIGHT)

Def the click () :
V1. The get ()
B1=Button (root, text='confirmed', the command=click, width=15, height=3)
B1. Pack ()
Root. Mainloop ()
Input_search3=driver. Find_element_by_id (" code "). The send_keys (v1. The get ())
Input_search4=driver. Find_element_by_xpath ('//* [@ id="login"]/form/div [5]/div/button '). Click ()
Time. Sleep (3)

The from the selenium. Webdriver. Support the import expected_conditions as EC

Result=EC. Alert_is_present # (the) (driver) to judge whether the login success

If the result:
Print (" Error: ", the result. The text)
Tkinter. Messagebox. Showerror (' Error, the result text)
Result. The accept ()

The else:
Print (" Success!" )

Driver. The quit ()
  • Related