User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 426,659 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,549 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums
Views: 442 | Replies: 3
Reply
Join Date: Nov 2006
Posts: 23
Reputation: Haze is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Haze Haze is offline Offline
Newbie Poster

Question tkinter widget method problem

  #1  
Feb 9th, 2008
im trying to use the .get() method to get all the text from a tkinter text widget. the code im using is
text = root.textwidget.get(1,end)

i get the error "name error: global name 'end' is not defined"

is there a word specficly for the end of the text or am i going about this the wrong way?

edit: ok all i had to do was change end to END. But now the error is "TclError Bad text index "1""
Last edited by Haze : Feb 9th, 2008 at 8:10 am.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2008
Posts: 603
Reputation: ZZucker is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 21
ZZucker's Avatar
ZZucker ZZucker is offline Offline
Practically a Master Poster

Re: tkinter widget method problem

  #2  
Feb 9th, 2008
I think you have to use either END or 'end' and 1.0 for line.column.
Last edited by ZZucker : Feb 9th, 2008 at 12:18 pm.
Never argue with idiots, they'll just bring you down to their level and beat you with their experience.
Reply With Quote  
Join Date: Nov 2006
Posts: 23
Reputation: Haze is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
Haze Haze is offline Offline
Newbie Poster

Re: tkinter widget method problem

  #3  
Feb 9th, 2008
yep that was it i figured it out myself but didnt get round to replying to this yet. i do have another problem though. One of the functions i have for the program runs through twice when the program starts (because it is the command of 2 buttons) but then it doesn't run after that when i press the buttons that have this function as their command. Either that or the shell doesn't display any print statements after the initial 2 runs (which is possible because it doesn't display the output of commands i type directly into it) AND the function isnt working properly and therefore doesn't display any output on the GUI either. Any common mistakes that cause this or should i post my code and if so what bits because the program is quite large (well by my standards)
Reply With Quote  
Join Date: Jan 2008
Posts: 603
Reputation: ZZucker is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 21
ZZucker's Avatar
ZZucker ZZucker is offline Offline
Practically a Master Poster

Re: tkinter widget method problem

  #4  
Feb 10th, 2008
yep, let's see your code, or see if you can repeat your problems with a shorter code. I am learning myself to code with the Tkinter GUI toolkit right now in my science class.
Never argue with idiots, they'll just bring you down to their level and beat you with their experience.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Python Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Python Forum

All times are GMT -4. The time now is 1:45 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC