954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

tkinter text widget help

hi i got a a Tkinter text widget and a string i want to know how to display the string in the text widget ??

abc = "hello world" 

text = Text(app, width=80,height=40, wrap='none').grid(row=2, column=2)
moroccanplaya
Junior Poster
178 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

solved

moroccanplaya
Junior Poster
178 posts since May 2010
Reputation Points: 10
Solved Threads: 0
 

Here is example ...

# one look at the Tkinter Text widget
# use ctrl+c to copy, ctrl+x to cut selected text, 
# ctrl+v to paste, and ctrl+/ to select all
# text area can be scrolled with mouse wheel

import Tkinter as tk

root = tk.Tk()

# create the text widget
# width=width in chars, height=lines of text
text = tk.Text(root, width=50, height=5, wrap='none', bg='yellow')
text.pack()

abc = "hello world" 

# show result in text widget
text.insert('insert', abc)

# start cursor in the text widget
text.focus()

root.mainloop()
bumsfeld
Nearly a Posting Virtuoso
1,445 posts since Jul 2005
Reputation Points: 404
Solved Threads: 184
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You