By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,921 Members | 1,433 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,921 IT Pros & Developers. It's quick & easy.

Can a Tkinter GUI check for abort script:

P: n/a
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
Dec 18 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
hg
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

Dec 19 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.