LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-18-2011, 01:31 PM   #1
rockharley
LQ Newbie
 
Registered: Apr 2011
Posts: 3

Rep: Reputation: 0
TKinter text widget clear


hello, i have written some code to analyze some data and then write a text file containing the results. i then display the text file in a text widget. problem is that i want to clear the contents of the text widget upon the initiation of a run, so that old data is not still displayed before the new results become available. i cannot get the widget to clear during a run any suggestions?
 
Old 04-18-2011, 03:39 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,609

Rep: Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702
Tkinter is an interface to tcl/tk. The Tk to clear a Text widget is "delete 1.0 end"
 
Old 04-19-2011, 01:34 PM   #3
rockharley
LQ Newbie
 
Registered: Apr 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks. I tried that as a line of code in my file and it gave me a syntax error. any suggestions?
 
Old 04-20-2011, 12:28 PM   #4
rockharley
LQ Newbie
 
Registered: Apr 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Could someone tell me how to clear the text widget as described above?
 
Old 08-15-2012, 09:50 PM   #5
JackeyKing
LQ Newbie
 
Registered: Aug 2012
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by rockharley View Post
Could someone tell me how to clear the text widget as described above?
Text.delete(1.0, Tkinter.END) can totally clear the text
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
basic python entry tkinter widget how-to donnied Programming 2 03-30-2008 11:36 AM
A good simple text display widget in GTK (not Label) vharishankar Programming 3 05-18-2006 06:44 AM
Tcl/Tk: Set Value of Text Widget Kenji Miyamoto Programming 1 06-26-2005 09:53 PM
Rich Text Widget/Database Front End Stranger Programming 5 10-03-2004 07:37 PM
GUI test tool to perform widget functions via a text file liguorir Linux - Software 0 01-05-2004 03:30 PM


All times are GMT -5. The time now is 10:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration