Home > other >  Python Tkinter realize the click of a button, you can upload an image, and put the pictures to the c
Python Tkinter realize the click of a button, you can upload an image, and put the pictures to the c

Time:11-22

Python Tkinter realize the click of a button, you can upload an image, and put the pictures to the current interface to do?
Want to achieve this effect, could you tell me how to do? I have no experience in Tkinter,



CodePudding user response:

Do you know how to implement the to this question? I also want to realize this function,

CodePudding user response:

Do you realize? Can you please teach me, I also want to realize this,

CodePudding user response:

 import tkinter 
The import tkinter. Filedialog
Top=tkinter. Tk ()
Top. Title='new'
Top. Geometry (' 640 x480)



Def choose_fiel () :
SelectFileName=tkinter. Filedialog. Askopenfilename (title='select files') # select files
E.s et (selectFileName)



E=tkinter. StringVar ()
E_entry=tkinter. Entry (top, width=68, textvariable=e)
E_entry. Pack ()


Def upload_func (a) :
"'
Want to write a method, methods of FTP, upload files to the server

"'
Print (a)
Pass


Submit_button=tkinter. Button (top, text="select files", the command=choose_fiel)
Submit_button. Pack ()
Submit_button=tkinter. Button (top, text="upload", the command=lambda: upload_func (e_entry. The get ()))
Submit_button. Pack ()

The from PIL import Image, ImageTk
Def showImg (img1) :
The load=Image. Open (img1)
Render=ImageTk. PhotoImage (load)

Img=tkinter. Label (image=render)
Img. Image=render
Img. Place (x=200, y=100)

Submit_button=tkinter. Button (top, text="image", the command=lambda: showImg (showImg (' the path of the PIC on the server ')))
Submit_button. Pack ()



Top. Mainloop ()

CodePudding user response:

May I have your this function implements? We have some questions want to consult you it's convenient for you can add my qq397200181 thank you

CodePudding user response:

Simple to use python tkinter module
  • Related