Advertisement
here2share

# Tk_Find_and_Replace_GUI.py

Jan 9th, 2022
1,353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.18 KB | None | 0 0
  1. # Tk_Find_and_Replace_GUI.py
  2.  
  3. from tkinter import *
  4. parent=Tk()
  5. parent.title('Find & Replace')
  6.  
  7. Label(parent,text="Find:").grid(row=0,column=0,sticky='e')
  8. Entry(parent,width=60).grid(row=0,column=1,padx=2,pady=2,sticky='we',columnspan=9)
  9. Label(parent,text="Replace:").grid(row=1,column=0,sticky='e')
  10. Entry(parent).grid(row=1, column=1,padx=2, pady=2, sticky='we', columnspan=9)
  11. Button(parent,text="Find").grid(row=0,column=10,sticky='e'+'w',padx=2)
  12. Button(parent,text="Find All").grid(row=1,column=10,sticky='e'+'w',padx=2)
  13. Button(parent,text="Replace").grid(row=2,column=10,sticky='e'+'w',padx=2)
  14. Button(parent,text="Replace All").grid(row=3,column=10,sticky='e'+'w',padx=2)
  15. Checkbutton(parent,text='Match whole word only').grid(row=2,column=1,columnspan=4,sticky='w')
  16. Checkbutton(parent,text='Match Case').grid(row=3,column=1,columnspan=4,sticky='w')
  17. Checkbutton(parent,text='Wrap around').grid(row=4,column=1,columnspan=4,sticky='w')
  18. Label(parent,text="Direction:").grid(row=2,column=6,sticky='w')
  19. Radiobutton(parent,text='Up',value=1).grid(row=3,column=6,columnspan=6,sticky='w')
  20. Radiobutton(parent,text='Down',value=2).grid(row=3,column=7,columnspan=2,sticky='e')
  21. parent.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement