SHARE
TWEET

Untitled

a guest Jun 19th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import tkinter as tk
  2.  
  3. from tkinter import *
  4. import tkinter.filedialog as fdialog
  5.  
  6. class karl(Frame):
  7.   def __init__(self):
  8.     tk.Frame.__init__(self)
  9.     self.pack(fill = tk.BOTH)
  10.     self.master.title("Image Selector")
  11.     self.master.geometry("500x500")
  12.     self.master.resizable(0, 0)
  13.     self.pack_propagate(0)
  14.  
  15.     self.label_button_1 = Label(self, text="Select directory for picking images")
  16.     self.label_button_1.grid(row = 0, column = 1, rowspan = 1, columnspan = 2, sticky = W)
  17.  
  18.     self.button_1 = tk.Button(self, text="CLICK HERE", width=25, command=self.open_dialog_box_to_select_folder)
  19.     self.button_1.grid(row=0, column=20, rowspan=1, columnspan=2, sticky=E)
  20.  
  21.     self.label_for_label_directory = Label(self, text="Current chosen directory")
  22.     self.label_for_label_directory.grid(row=20, column=1, rowspan=1, columnspan=2, sticky=E)
  23.  
  24.     self.label_directory = Label(self, text="")
  25.     self.label_directory.grid(row=20, column=5, rowspan=1, columnspan=2, sticky=W)
  26.  
  27.     self.label_for_entry_for_class_label_values = Label(self, text="Enter (+) seperated class labelsnto be assigned to the images")
  28.     self.label_for_entry_for_class_label_values.grid(row = 24, column = 1, rowspan = 1, columnspan = 2, sticky = W)
  29.  
  30.     self.entry_for_class_label_values = Entry(self)
  31.     self.entry_for_class_label_values.grid(row = 24, column = 5, rowspan = 1, columnspan = 2, sticky = E)
  32.  
  33.  
  34.   def open_dialog_box_to_select_folder(self):
  35.  
  36.     self.chosen_directory_name = fdialog.askdirectory()
  37.     self.label_directory.config(text = self.chosen_directory_name)
  38.  
  39.  
  40.  
  41. def main():
  42.    karl().mainloop()
  43.  
  44. if __name__ == '__main__':
  45.    main()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top