tkkillablethreads


Nametkkillablethreads JSON
Version 0.10 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/tkkillablethreads
SummaryKillable, non-blocking threads for tkinter
upload_time2024-03-18 01:28:32
maintainer
docs_urlNone
authorJohannes Fischer
requires_python
licenseMIT
keywords tkinter threads
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# 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()
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/tkkillablethreads",
    "name": "tkkillablethreads",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "tkinter,threads",
    "author": "Johannes Fischer",
    "author_email": "aulasparticularesdealemaosp@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/2b/17/f63392e4f1b4adbfe5f794072473762c0e965c7ffb12152bad7244a68e82/tkkillablethreads-0.10.tar.gz",
    "platform": null,
    "description": "\r\n# Killable, non-blocking threads for tkinter \r\n\r\n## Tested against Windows / Python 3.11 / Anaconda\r\n\r\n### Made for tkinter, but can be used without it too!\r\n\r\n```py\r\nfrom tkinter import *\r\nfrom tkinter import messagebox\r\nfrom tkkillablethreads import ExecuteAsThreadedTask\r\nimport time\r\n\r\n\r\ndef sleepprinter(*args, **kwargs):\r\n    print(args, kwargs)\r\n    for q in range(7):\r\n        print(\"sleeping\")\r\n        time.sleep(1)\r\n    messagebox.showinfo(\"Thread Ready\", f\"Results Ready - check: c.results \")\r\n    return \"bab\"\r\n\r\n\r\ntop = Tk()\r\ntop.geometry(\"100x400\")\r\nc = ExecuteAsThreadedTask(fu=sleepprinter, args=(\"baba\", \"bbu\"), kwargs={\"oi\": \"badxx\"})\r\n\r\n\r\ndef threadCallBack():\r\n    c()\r\n    messagebox.showinfo(\"Started Thread\", str(c))\r\n\r\n\r\ndef threadCallBack2():\r\n    c.killthread()\r\n    messagebox.showinfo(\"Killed Thread\", str(c))\r\n\r\n\r\nB = Button(top, text=\"Start Thread\", command=threadCallBack)\r\nB.pack()\r\nBCancel = Button(top, text=\"Cancel Thread\", command=threadCallBack2)\r\nBCancel.pack()\r\ntop.mainloop()\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Killable, non-blocking threads for tkinter",
    "version": "0.10",
    "project_urls": {
        "Homepage": "https://github.com/hansalemaos/tkkillablethreads"
    },
    "split_keywords": [
        "tkinter",
        "threads"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4d53e426bec1ceb2e6c0f84ce0db108cce26341080c8ab9070adae53b0188821",
                "md5": "e8f706d5e070c103cdb8ff7b45cea1dd",
                "sha256": "44a4ed430e02e8871ffdae81c5bf85dc780a3ab54b2325c1efc53d6ca2dfc3d8"
            },
            "downloads": -1,
            "filename": "tkkillablethreads-0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e8f706d5e070c103cdb8ff7b45cea1dd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4738,
            "upload_time": "2024-03-18T01:28:28",
            "upload_time_iso_8601": "2024-03-18T01:28:28.431965Z",
            "url": "https://files.pythonhosted.org/packages/4d/53/e426bec1ceb2e6c0f84ce0db108cce26341080c8ab9070adae53b0188821/tkkillablethreads-0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2b17f63392e4f1b4adbfe5f794072473762c0e965c7ffb12152bad7244a68e82",
                "md5": "b7e39b2c1cdc509a84a16856fee33250",
                "sha256": "833f11c1c55a18be67fd465c016352adbeba5d962fb57f31b89a5a0c3b8d6eea"
            },
            "downloads": -1,
            "filename": "tkkillablethreads-0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "b7e39b2c1cdc509a84a16856fee33250",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3889,
            "upload_time": "2024-03-18T01:28:32",
            "upload_time_iso_8601": "2024-03-18T01:28:32.814225Z",
            "url": "https://files.pythonhosted.org/packages/2b/17/f63392e4f1b4adbfe5f794072473762c0e965c7ffb12152bad7244a68e82/tkkillablethreads-0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-18 01:28:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hansalemaos",
    "github_project": "tkkillablethreads",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "tkkillablethreads"
}
        
Elapsed time: 0.19749s