Metadata-Version: 2.1
Name: tkkillablethreads
Version: 0.10
Summary: Killable, non-blocking threads for tkinter
Home-page: https://github.com/hansalemaos/tkkillablethreads
Author: Johannes Fischer
Author-email: aulasparticularesdealemaosp@gmail.com
License: MIT
Keywords: tkinter,threads
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Description-Content-Type: text/markdown
License-File: LICENSE.rst


# Killable, non-blocking threads for tkinter 

## Tested against Windows / Python 3.11 / Anaconda

### Made for tkinter, but can be used without it too!

```py
from tkinter import *
from tkinter import messagebox
from tkkillablethreads import ExecuteAsThreadedTask
import time


def sleepprinter(*args, **kwargs):
    print(args, kwargs)
    for q in range(7):
        print("sleeping")
        time.sleep(1)
    messagebox.showinfo("Thread Ready", f"Results Ready - check: c.results ")
    return "bab"


top = Tk()
top.geometry("100x400")
c = ExecuteAsThreadedTask(fu=sleepprinter, args=("baba", "bbu"), kwargs={"oi": "badxx"})


def threadCallBack():
    c()
    messagebox.showinfo("Started Thread", str(c))


def threadCallBack2():
    c.killthread()
    messagebox.showinfo("Killed Thread", str(c))


B = Button(top, text="Start Thread", command=threadCallBack)
B.pack()
BCancel = Button(top, text="Cancel Thread", command=threadCallBack2)
BCancel.pack()
top.mainloop()
```
