Untangling pythonWin and IDLE Processes on XP Pro

W

W. eWatson

It appears if one moves between IDLE and pythonWin (pyWin) that two separate
loops (threads?) can occur, and that IDLE can produce incorrect results.
Since I have preferred IDLE over pyWin, that leaves me currently in a
quandry. How do I renew these processes, so that I can proceed with IDLE?

I noticed that I had about 10-15 copies of pythonw.exe as I tried to reach
some understanding of what was going on. Killing these tasks didn't help
restore order to IDLE. It seems my only choice now is to reboot? Comments?
--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>
 
D

Diez B. Roggisch

W. eWatson said:
It appears if one moves between IDLE and pythonWin (pyWin) that two
separate loops (threads?) can occur, and that IDLE can produce incorrect
results. Since I have preferred IDLE over pyWin, that leaves me currently
in a quandry. How do I renew these processes, so that I can proceed with
IDLE?
I noticed that I had about 10-15 copies of pythonw.exe as I tried to reach
some understanding of what was going on. Killing these tasks didn't help
restore order to IDLE. It seems my only choice now is to reboot? Comments?

Gosh no, rebooting shouldn't be needed. Just quit all idle & pywin
processes, including of course the main programs. Which *should* be
anything that is needed anyway.

And you still seem to not understand what is really happening.

Working between pywin and idle is perfectly fine, they are separate
programs. You can start as many instances of a program as you want and
happily work with them. Even several instances of idle and pywin, unless
these come with some logic to prevent multiple starts - some windows app
do that.

What does *NOT* work is writing a Tkinter-based app in idle, and to run it
*FROM INSIDE* idle. Instead, open your explorer and double-click on the
pyhton-file your app is in. That's all that there is to it.

Diez
 
W

W. eWatson

Diez said:
Gosh no, rebooting shouldn't be needed. Just quit all idle & pywin
processes, including of course the main programs. Which *should* be
anything that is needed anyway.
Done that. Been there. It doesn't work. If I take another py tkinter program
and run it in IDLE, it *will work*. The current program goes boom.
And you still seem to not understand what is really happening.
Whether I understand it exactly or not is not the issue. The issue is how do
I execute IDLE *now* to get the correct results it once allowed? The fact of
the matter is that I was happily working in IDLE for days and hours. I
encountered a problem in IDLE that seemed suspicious, so I then fired up
pyWin to see if it gave the same results. It worked fine. Then my problems
with IDLE got worse.
Working between pywin and idle is perfectly fine, they are separate
programs. You can start as many instances of a program as you want and
happily work with them. Even several instances of idle and pywin, unless
these come with some logic to prevent multiple starts - some windows app
do that.
How could this be true; otherwise, I wouldn't be complaining?
What does *NOT* work is writing a Tkinter-based app in idle, and to run it
*FROM INSIDE* idle. Instead, open your explorer and double-click on the
pyhton-file your app is in. That's all that there is to it.
Personally, I like running entirely in IDLE.

If there is no other way than you suggested in "NOT work", then I may just
uninstall pyWin.


--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>
 
M

Mike Driscoll

Done that. Been there. It doesn't work. If I take another py tkinter program
and run it in IDLE, it *will work*. The current program goes boom.


Whether I understand it exactly or not is not the issue. The issue is how do
I execute IDLE *now* to get the correct results it once allowed? The fact of
the matter is that I was happily working in IDLE for days and hours. I
encountered a problem in IDLE that seemed suspicious, so I then fired up
pyWin to see if it gave the same results. It worked fine. Then my problems
with IDLE got worse.


How could this be true; otherwise,  I wouldn't be complaining?


Personally, I like running entirely in IDLE.

If there is no other way than you suggested in "NOT work", then I may just
uninstall pyWin.




--
                                W. eWatson

              (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
               Obz Site:  39° 15' 7" N, 121° 2' 32" W, 2700 feet

                     Web Page: <www.speckledwithstars.net/>

I like IDLE too. However, I've experienced seemingly random crashes
when programming wxPython programs in it. As already stated, the
mainloops clash from time to time. So now I use Wingware or just edit
the files in IDLE and run the program by double-click or via command
line.

Mike
 
W

W. eWatson

As with Diez, I simply ask, "How do I get around the problem?" Are you two
telling me that it is impossible?

OK, here's my offer to both of you. Do you have IDLE for Python 2.5 and have
good familiarity with Tkinter? If so, I'll send you the code and you can
try it yourself. My guess is that it will work, and if not, and you are
sufficiently skilled with Tkinter and debugging, you may find the problem in
the code. The steps to create the problem are very easy.

--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>
 
W

W. eWatson

W. eWatson said:
As with Diez, I simply ask, "How do I get around the problem?" Are you
two telling me that it is impossible?

OK, here's my offer to both of you. Do you have IDLE for Python 2.5 and
have good familiarity with Tkinter? If so, I'll send you the code and
you can try it yourself. My guess is that it will work, and if not, and
you are sufficiently skilled with Tkinter and debugging, you may find
the problem in the code. The steps to create the problem are very easy.
Well, this may be a bit trickier than I thought. I'd have to give you the
same PIL, tkinter, numpy libraries the program users. However, I"m willing
to send the files for them to you. Here's the start of the code

=====================
from Tkinter import *
from numpy import *
import Image
import ImageChops
import ImageTk
import ImageDraw # wtw
import time
import binascii
import tkMessageBox
import tkSimpleDialog
from pylab import plot, xlabel, ylabel, title, show, xticks, bar

from tkFileDialog import asksaveasfilename, asksaveasfile
from tkFileDialog import askopenfilename

import MakeQTE
=======================
You'd also need clut.txt, wagon.gif, and MakQTE. All small files.

--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>
 
D

Diez B. Roggisch

W. eWatson said:
As with Diez, I simply ask, "How do I get around the problem?" Are you two
telling me that it is impossible?

YES. That's what we and all the others who answered to you in the other
thread are telling you, repeatedly. It is impossible. Really. No kidding.
For sure. Jawoll, ganz sicher sogar.

Diez
 
T

Terry Reedy

W. eWatson said:
As with Diez, I simply ask, "How do I get around the problem?" Are you
two telling me that it is impossible?

Try this analogy. One television, two stubborn kids that want to watch
different programs. One has the remote, the other the buttons on the
TV. What happens? How do you make both happy. Solve that and get rich
;-).

Even better analogy. One inbox. Two people on opposite sides each want
'first dibs' on each item that drops. How do you make them both happy,
especially if they are equally stubborn clones?

OK, here's my offer to both of you. Do you have IDLE for Python 2.5 and
have good familiarity with Tkinter? If so, I'll send you the code and
you can try it yourself. My guess is that it will work, and if not, and
you are sufficiently skilled with Tkinter and debugging, you may find
the problem in the code. The steps to create the problem are very easy.

That is a request, not an offer.
 
W

W. eWatson

Greetings and salutations.

I just uninstalled all traces of (Active) pythonWin 2.5.2 from this machine,
In fact, I uninstalled python 2.5.2 with IDLE from this machine. I then
reinstalled the latter. Then I ran the program. XP Pro.

I then went to another machine that has never had pythonWin on it all, but
does have python 2.5.2 with IDLE. I ran the same program there. W2K.

In both cases, I got the output below. Your conclusions?

===========================Output on Interactive Shell Screen===========
GUI self----------->>>>: <__main__.Sentuser_GUI instance at 0x02154058>
counter: 3
OSett self = <__main__.Sentuser_GUI instance at 0x02154058> type = <type
'instance'>
gray scale now--wtw: True
Set OSDiag sdict
body from OSDialog, self = .35167928 type = <type 'instance'>
apply OSD ok
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python25\Lib\lib-tk\Tkinter.py", line 1403, in __call__
return self.func(*args)
File
"C:\Sandia_Meteors\New_Sentinel_Development\Sentuser_Utilities_Related\sentuser\sentuserNC25-Dev4.py",
line 553, in OperationalSettings
dialog = OperationalSettingsDialog( self.master, set_loc_dict )
File
"C:\Sandia_Meteors\New_Sentinel_Development\Sentuser_Utilities_Related\sentuser\sentuserNC25-Dev4.py",
line 81, in __init__
tkSimpleDialog.Dialog.__init__(self, parent)
File "C:\Python25\lib\lib-tk\tkSimpleDialog.py", line 69, in __init__
self.wait_visibility() # window needs to be visible for the grab
File "C:\Python25\Lib\lib-tk\Tkinter.py", line 415, in wait_visibility
self.tk.call('tkwait', 'visibility', window._w)
TclError: window ".35167928" was deleted before its visibility changed


--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>
 
R

Rhodri James

Greetings and salutations.

I just uninstalled all traces of (Active) pythonWin 2.5.2 from this
machine, In fact, I uninstalled python 2.5.2 with IDLE from this
machine. I then reinstalled the latter. Then I ran the program. XP Pro.

I then went to another machine that has never had pythonWin on it all,
but does have python 2.5.2 with IDLE. I ran the same program there. W2K.

In both cases, I got the output below. Your conclusions?

That you haven't listened to a word anyone has said.
 
W

W. eWatson

From Diez above.
What does *NOT* work is writing a Tkinter-based app in idle, and to run it
*FROM INSIDE* idle. Instead, open your explorer and double-click on the
pyhton-file your app is in. That's all that there is to it.

So this is the absolute truth? No wiggle room? One can never use a Tkinter
program with IDLE, and execute it successfully. So IDLE doesn't issue a
standard warning that says, "Get out of here with your Tkinter program, it
will fail when you try to run it here. You have entered Tkinter hell.
Good-bye."

--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>
 
T

Terry Reedy

W. eWatson said:
From Diez above.
What does *NOT* work is writing a Tkinter-based app in idle, and to run it
*FROM INSIDE* idle. Instead, open your explorer and double-click on the
pyhton-file your app is in. That's all that there is to it.

So this is the absolute truth? No wiggle room? One can never use a
Tkinter program with IDLE, and execute it successfully. So IDLE doesn't
issue a standard warning that says, "Get out of here with your Tkinter
program, it will fail when you try to run it here. You have entered
Tkinter hell. Good-bye."

Re-read my post about kids fighting to control a television. Maybe they
work together, maybe they crash the TV. Hard to predict.

***ANY*** Python program that tries to grab and control the same
resources that TK does may conflict with it. There is no way that IDLE
can have a list of, for instance, all event-grabbing mainloop programs.
 
W

W. eWatson

Terry said:
Re-read my post about kids fighting to control a television. Maybe they
work together, maybe they crash the TV. Hard to predict.

***ANY*** Python program that tries to grab and control the same
resources that TK does may conflict with it. There is no way that IDLE
can have a list of, for instance, all event-grabbing mainloop programs.
OK, enough tinkering with the code and others matters on my end trying to
find a work around. Somehow after much successful use of IDLE's execution
facility, I've stepped on an invisible banana peel. I think it's evident
that I'm not going around this problem easily with the IDLE execution
attempts, and that another solution is required.

First, I think somewhere up the thread someone suggested that Active
pythonWin is not dependent upon Tk, correct? Therefore, it is immune from
such problems, correct?

Second, maybe I missed it above, but when I posted the output from the
program that showed the failure, was there anything that said, "IDLE
problem" or would even give a clue that's the culprit?

Finally, we can probably agree that I can continue to use IDLE for editing
and syntax checking, but to "guarantee" successful execution of the program,
I can just double-click on the py file in my folder. Perhaps there is a
better way than clicking on it in the folder. For example, putting it on the
desktop. As I look at the folder, previous copies only differ by a digit, I
can easily find myself executing an earlier version, differing as Dev4, to
Dev5 at the end of each name.

Let me ask this. When I install Active Python, am I getting something beyond
their interface? That is, does executing the code there result in using the
same python interpreter that is used by IDLE? My use of their editor has
been somewhat exasperating. It does not seem as friendly as the IDLE editor.

I still find it bizarre that the original creator of this program can spend
months using IDLE to develop this program, and that I've spent maybe 10 days
recently now adding to it without having much, if any, problem with IDLE and
the programs execution within IDLE. I asked him almost a year ago what tool
he used. IDLE, was the reply. Maybe it was really IDLE with no execution
from inside IDLE. I'll ask him.

--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>
 
R

Rhodri James

OK, enough tinkering with the code and others matters on my end trying
to find a work around. Somehow after much successful use of IDLE's
execution facility, I've stepped on an invisible banana peel. I think
it's evident that I'm not going around this problem easily with the IDLE
execution attempts, and that another solution is required.

Congratulations, we've only been telling you this for the last few days.
I wonder, is there any chance that you've noticed the solution given?
First, I think somewhere up the thread someone suggested that Active
pythonWin is not dependent upon Tk, correct?

Someone certainly suggested that something is based on Microsoft
Foundation Classes, which isn't very likely to be Tk-based :)
Whatever that something is, I'm pretty sure it isn't called "Active
pythonWin".
Therefore, it is immune from such problems, correct?

No.

Let me put it like this. Your Tkinter program is listening out for
events like windows being moved, the mouse being clicked, keys being
pressed and so on. IDLE also listens out for a selection of events
of the same sort. A different graphical IDE will do the same, but will
trap and interpret the events in an entirely different manner that is
probably not even a little bit compatible with your program. When
you run your program from inside *any* IDE, not just IDLE, it's a bit
of a lottery as to whether your program gets an event, or the IDE
does. Chances are, *both* need to see it, at which point you're
stuck.

It is possible to do this successfully, but only in a very limited
way and only if you're very careful. If you think either of those
conditions hold, you are wrong.

Second, maybe I missed it above, but when I posted the output from the
program that showed the failure, was there anything that said, "IDLE
problem" or would even give a clue that's the culprit?

How can it? It's not IDLE's problem, it's yours.
Finally, we can probably agree that I can continue to use IDLE for
editing and syntax checking, but to "guarantee" successful execution of
the program, I can just double-click on the py file in my folder.
Perhaps there is a better way than clicking on it in the folder.

Typing at a command prompt.
For example, putting it on the desktop.

This causes an extra file read as Windows indirects through the desktop
link. It's unlikely to be a noticeable delay at startup, but I'd
hesitate to call it "better".
As I look at the folder, previous copies only differ by a digit, I can
easily find myself executing an earlier version, differing as Dev4, to
Dev5 at the end of each name.

I'd suggest spending a while reading up on version control systems.
 
W

W. eWatson

Scott said:
That's correct, but you still don't understand _why_ it is correct.
I suggest you re-read the thread and try to understand everything you
are being told.


Wrong. I was the one who said that ActiveState had a product to debug
Python programs across a nertwork connection. The product is _not_
ActivePython (the freely distributed system), but rather the Komodo IDE,
which does cost money.
I'm pretty sure it wasn't you, and had no relationship to what you brought
up earlier several messages up the thread. There are other forums.
OK, you are using the oldest and least useful revision control system,
"rename and remember." I'd suggest you get and use bazaar, but you'll
just ask for shortcuts on how to use it without understanding what it does.
It works for me, and, frankly, I'm not interested in going to Linux, SunOS
or other "revision systmes". These are way in my distant past, and the only
reason I'm currently, and begrudgingly, once again writing programs is that
the Python software program I am using is limited in its ability. I've
finally, after 2-3 years of hoping someone else would do it, taken up the
torch to add new features. Frankly, I'd rather be doing something else with
my time.

And, yes, you are somewhat correct in your earlier assessment of my goals,
the sooner this is over the better. You may not like my philosophy, but it
serves me well at the moment, and I'm moving ahead nicely now.

As I recall from the old movie Desk Set, a conversation between their two
characters regarding a puzzle he was about to give her as a test of her
office abilities: Tracy cautions Hepburn, "Never assume!" before relating
the famous "detective" problem. Never assume.

Nevertheless, thank you for your responses.
Be kind to your keyboard.

Cheers.
--Scott David Daniels
(e-mail address removed)


--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>
 
W

W. eWatson

....
How can it? It's not IDLE's problem, it's yours.


Typing at a command prompt.


This causes an extra file read as Windows indirects through the desktop
link. It's unlikely to be a noticeable delay at startup, but I'd
hesitate to call it "better".


I'd suggest spending a while reading up on version control systems.
See my response to Scott. Thanks for your reply.

--
W. eWatson

(121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
Obz Site: 39° 15' 7" N, 121° 2' 32" W, 2700 feet

Web Page: <www.speckledwithstars.net/>
 
M

Marc 'BlackJack' Rintsch

It works for me, and, frankly, I'm not interested in going to Linux,
SunOS or other "revision systmes".

Linux and SunOS are *operating systems*, something completely different
from *revision control systems*.

A revision or version control system (VCS) lets you record the evolution
of your software. You can tag versions with symbolic names like "Dev4"
or "Release-1.0" and can ask the VCS for a copy of the sources with a
given tag or even date.

Ciao,
Marc 'BlackJack' Rintsch
 
T

Thorsten Kampe

* Rhodri James (Fri, 13 Feb 2009 22:57:42 -0000)
Congratulations, we've only been telling you this for the last few days.
I wonder, is there any chance that you've noticed the solution given?

The Lord gives and the Lord takes. Sometimes it just takes a bit
longer...

Thorsten
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top