Can a Tkinter GUI check for abort script:
Michael Yanowitz
m.yanowitz at kearfott.com
Tue Dec 19 15:19:28 EST 2006
-----Original Message-----
From: python-list-bounces+m.yanowitz=kearfott.com at python.org
[mailto:python-list-bounces+m.yanowitz=kearfott.com at python.org]On Behalf
Of hg
Sent: Tuesday, December 19, 2006 9:44 AM
To: python-list at python.org
Subject: Re: Can a Tkinter GUI check for abort script:
Michael Yanowitz wrote:
> Hello:
>
> I have successfully implemented a Tkinter GUI which has
> this (simplified here for explanation):
> +-------------------------------------+
> | filename: [ ./test3.py] |
> | |
> | [Run Script] |
> +-------------------------------------+
>
> But, now what I would like to do while the script is
> running, is replace the "Run Script" with "Abort Script".
>
> +-------------------------------------+
> | filename: [ ./test3.py] |
> | |
> | [Abort Script] |
> +-------------------------------------+
>
> So, every tenth of a seconds or ??? better time, I
> would like to 'return' to the GUI and check if the
> "Abort Script" button has been pressed.
> How do I do this? Or is there a better way to
> implement this?
>
> Thanks in advance:
> Michael Yanowitz
It depends: As you cannot "kill" a thread in Python, you need some mechanism
to stop your script another way (is that a python script or
a .sh / .bat ? ... from what you're writing, it seems you're calling some
external entity which just might launch a bunch of processes)
So do you or not control the inner workings of that external script ?
If you don't, then "killing" might be the way as posted / clearly the
methord will change from environment to environment.
hg
--
Yeah, it is a Python script, which I preprocess and then load using
__import__(script_filename)
So when I preprocess it, I can add/remove codelines and possibly
add control of the GUI - the original Python scripts will not
know anything about the GUI.
Thanks:
Michael Yanowitz
More information about the Python-list
mailing list