Exemplo n.º 1
0

def copyText(Tarea):
    string = Tarea.get('1.0', END)
    # sudo apt-get install xclip xsel
    # this is necessary for ubuntu machines-- to use piperclip
    pyperclip.copy(string)
    print("should be copied")
    print("thsi is string:", string)


# Save as a File Button
row4 = Frame(root)
btn = Button(row4,
             text='Save as a File',
             command=(lambda Tarea=T: save(Tarea))).pack(side=RIGHT, padx=3)

btn1 = Button(row4,
              text="Copy To Clipboard",
              command=(lambda Tarea=T: copyText(Tarea))).pack(side=RIGHT,
                                                              padx=1)
btn0112131 = Button(row4, text="Clear Cache",
                    command=cache.clear_cache).pack(side=LEFT, padx=1)

row4.pack(side=TOP, fill=X, padx=5, pady=5)

mainloop()

#At last store the final cache state in file
cache.store_to_file('default_cache')