Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

add button to python gui file

from tkinter import *   
root = Tk()             
root.geometry('100x100')
 
# Create a Button
btn = Button(root, text = 'Click me !', bd = '5',
                          command = root.destroy)
 
# Set the position of button on the top of window.  
btn.pack(side = 'top')   
 
root.mainloop()
Comment

add button to python gui file


import tkinter as tk
from tkinter import filedialog

def UploadAction(event=None):
    filename = filedialog.askopenfilename()
    print('Selected:', filename)

root = tk.Tk()
button = tk.Button(root, text='Open', command=UploadAction)
button.pack()

root.mainloop()

Comment

PREVIOUS NEXT
Code Example
Python :: python timedelta get days with fraction 
Python :: declare array python 
Python :: append string variable with integer python 
Python :: a star search algorithm python code 
Python :: how can i aggregate without group by in pandas 
Python :: ope pickle file 
Python :: scapy get packet source ip address python 
Python :: pyqt5 app styles 
Python :: plt grid linestyles options 
Python :: truncate spaces in python 
Python :: sum() python 
Python :: get image image memeory size in url inpyton requests 
Python :: convert string ranges list python 
Python :: sum of fraction numbers in python 
Python :: if any number python 
Python :: executing a python script interactively 
Python :: pass query params django template 
Python :: dbscan python 
Python :: bag of word scikit learn 
Python :: Acticating virtual environment 
Python :: label with list comprehension python 
Python :: normalized histogram pandas 
Python :: flask blueprints 
Python :: python download images from unsplash 
Python :: accumulator programming python 
Python :: python diferente de 
Python :: how to open py file without console 
Python :: import pyx file 
Python :: python not equal to 
Python :: create a dict from two lists 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =