Forums: » Register « |  Free Tools |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

New Free Tools on Dev Shed!

#1
March 30th, 2005, 01:57 AM
 burninator
Contributing User

Join Date: Mar 2005
Posts: 55
Time spent in forums: 17 h 23 m 45 sec
Reputation Power: 9
Tkinter stinker

Hi all,
A general question when using tkinter: has anyone noticed problems with running tkinter in IDLE? My system is hanging a lot, so I'm running test programs in dos instead. Shouldn't I be able to work with tkinter just like I do python? Sometimes I get error messages from tkinter about calling (self*args), and then I'll run the code again and get no errors. Is there some sort of secret trick someone is willing to let me in on? I'm not going huge into tkinter, just the basics, but I can't even seem to get the basic functionality of it down. Input appreciated!

#2
March 30th, 2005, 03:25 AM
 DavidPesta
Contributing User

Join Date: Mar 2004
Posts: 236
Time spent in forums: 2 Days 9 h 50 m
Reputation Power: 11
I strongly recommend looking into wxpython for GUI:
http://www.wxpython.org/

#3
March 30th, 2005, 04:45 AM
 mawe
Contributing User

Join Date: Nov 2004
Posts: 394
Time spent in forums: 1 Day 10 h 6 m 47 sec
Reputation Power: 51
Hi!

Isn't idle written in Tkinter? So if you are running Tkinker from from a Tkinter-application, there could be some conflicts (I don't really know this, I'm just guessing ).
Instead of using idle, you could work in Python's interactive mode (Just type python on the command line). There should be no problems then.

Regards, mawe
Grim Archon agrees: Yep, that is the solution.

#4
March 30th, 2005, 10:56 AM
 Dietrich
Contributing User

Join Date: Feb 2005
Posts: 576
Time spent in forums: 5 Days 4 h 53 m 16 sec
Reputation Power: 63
Dietrich says: I am using the PythonWin.exe IDE for my Tkinter code, works well.

#5
March 30th, 2005, 11:30 AM
 pord_80
Contributing User

Join Date: Mar 2005
Posts: 51
Time spent in forums: 1 Day 4 h 30 m 3 sec
Reputation Power: 9
String...

Hello,
Can anybody out there explain to me how to prompt a user to input a string a limited amount of time???

#6
March 30th, 2005, 11:07 PM
 burninator
Contributing User

Join Date: Mar 2005
Posts: 55
Time spent in forums: 17 h 23 m 45 sec
Reputation Power: 9

Hi! I like your suggestion because I need to stick with the simple things for this. But I'm not sure what you mean. I typed:
python
on the command line of both the python GUI(IDLE) and the DOS (command line) parts, but all I get is an NameError telling me python is not defined. Is there a step I'm missing? I'm good with python basics but I haven't expanded into the 'fancy' stuff yet. Please let me know!
thanks!
B.

Quote:
 Originally Posted by mawe Hi! Isn't idle written in Tkinter? So if you are running Tkinker from from a Tkinter-application, there could be some conflicts (I don't really know this, I'm just guessing ). Instead of using idle, you could work in Python's interactive mode (Just type python on the command line). There should be no problems then. Regards, mawe

#7
March 31st, 2005, 12:28 AM
 mawe
Contributing User

Join Date: Nov 2004
Posts: 394
Time spent in forums: 1 Day 10 h 6 m 47 sec
Reputation Power: 51
Hi!

Well, I don't really know how to do this on Windows because I only use Linux, but maybe you have to enter the whole path to the python executable, like
Code:
C:\path\to\python.exe

Regards, mawe

#8
March 31st, 2005, 02:21 AM
 hydroxide
Contributing User

Join Date: Feb 2005
Posts: 78
Time spent in forums: 21 h 40 m 18 sec
Reputation Power: 9
Quote:
 Originally Posted by burninator Hi all, A general question when using tkinter: has anyone noticed problems with running tkinter in IDLE? My system is hanging a lot, so I'm running test programs in dos instead. Shouldn't I be able to work with tkinter just like I do python? Sometimes I get error messages from tkinter about calling (self*args), and then I'll run the code again and get no errors. Is there some sort of secret trick someone is willing to let me in on? I'm not going huge into tkinter, just the basics, but I can't even seem to get the basic functionality of it down. Input appreciated!

By "hanging", do you mean hanging when the program terminates? If so, and you're using IDLE, you need to be calling root.quit(), etc. as clean up will not occur automatically.

--OH.

#9
March 31st, 2005, 05:14 AM
 Grim Archon
Mini me.

Join Date: Nov 2003
Location: Cambridge, UK
Posts: 783
Time spent in forums: 3 Days 2 h 15 m 57 sec
Reputation Power: 13
Quote:
 Originally Posted by burninator Hi! I like your suggestion because I need to stick with the simple things for this. But I'm not sure what you mean. I typed: python

In the Windows Start menu for Python2.x you should see an option to run Python (command line) .

As Dietrich says using PythonWin as your IDE might be more user friendly for you. You get the PythonWin IDE when you install the WIN32 extension package.
Pythonwin

grim
__________________
*** Experimental Python Markup CGI V2 ***

#10
March 31st, 2005, 06:48 PM
 wx_uab
Contributing User

Join Date: Jun 2004
Location: Bimingham,AL
Posts: 68
Time spent in forums: 14 h 58 m 22 sec
Reputation Power: 10
You might need to add path to python.exe to system path ( environ variable) . so that windows can find python program when you type python on command prompt

Quote:
 Originally Posted by burninator Hi! I like your suggestion because I need to stick with the simple things for this. But I'm not sure what you mean. I typed: python on the command line of both the python GUI(IDLE) and the DOS (command line) parts, but all I get is an NameError telling me python is not defined. Is there a step I'm missing? I'm good with python basics but I haven't expanded into the 'fancy' stuff yet. Please let me know! thanks! B.

#11
March 31st, 2005, 07:49 PM
 pylon
Contributing User

Join Date: Nov 2004
Posts: 88
Time spent in forums: 19 h 10 m 49 sec
Reputation Power: 10
In command prompt type the following:
Code:
>>>cd python24
>>>python

And then, everything should be fine, if you installed python version 2.4.x to C:\

#12
April 2nd, 2005, 11:28 AM
 burninator
Contributing User

Join Date: Mar 2005
Posts: 55
Time spent in forums: 17 h 23 m 45 sec
Reputation Power: 9
Thanks!

Thank you all,

 Viewing: Dev Shed Forums > Programming Languages > Python Programming > Tkinter stinker