Advertisement
smeech

Popup date selector

Jan 18th, 2025
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.74 KB | None | 0 0
  1. # Espanso popup date selector
  2.  
  3.   - trigger: :ddate
  4.     replace: '{{output}}'  
  5.     vars:
  6.       - name: output
  7.         type: script
  8.         params:
  9.           args:
  10.            - python
  11.             - -c
  12.             - |
  13.              from tkinter import Tk,Button
  14.               from tkcalendar import DateEntry
  15.               def get_date():
  16.                   selected_date = cal.get()
  17.                   print(f"Selected date: {selected_date}")
  18.                   root.destroy()
  19.               root = Tk()
  20.               cal = DateEntry(root, date_pattern="yyyy-mm-dd")
  21.               cal.pack()
  22.               btn = Button(root, text="Click Here To Return a Date ", command=get_date)
  23.               btn.pack()
  24.               root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement