0

I'm trying to asigne the ctr+s to save a Entry in a Tkinter program, but I don't even found it in the docs. Is there any possibility to do something like this :

def save():
   name = entry.get()
   text=textinput.get()
   file = open("./"+name,"w")
   file.write(text)
   file.close()

entry = Entry(window)
textinput = Text(window)
entry.pack()
textinput.pack()

--> asigne the 'save' command as 'ctr+s'

Please someone help me???

Waldi
  • 39,242
  • 6
  • 30
  • 78
wartonbega
  • 129
  • 6

1 Answers1

0

You can use this method to bind Ctrl-S to a function

name_of_widget.bind("<Control-S>", save)
Pranav Krishna S
  • 324
  • 2
  • 13