I’m trying to add a feature in python that copies the entire contents of two text widgets. How would one go about that?
Pseudo Code:
text1.SelectAll()
C1 = text1.get(Copy)
text2.SelectAll()
C2 = text2.get(Copy)
Paste('Widget 1:\n\n' + C1 + 'Widget 2:\n\n' + C2 )
Just do (if you have a
from Tkinter import *— I don’t like it but many use it):Now you have the two strings. I’m not sure where that
Pasteis supposed to put the text into — if you mean to replace the previous contents oftext2, for example, just doTo learn more about Tkinter text controls, read this chapter in effbot’s online Tkinter book.