
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
tkinter-async-execute
Advanced tools
Simple library that allows interaction between Tkinter and asyncio event loop running in a seperate thread.
Tkinter-Async-Execute is a small library, that provides a way to run an asyncio
event loop alongside Tkinter in
a separate thread.
It provides a way to execute methods of tkinter widgets from inside async functions and ability to call async functions from functions (commands / events) running in tkinter's thread. The former can be called from any thread (or async function) and the latter only from functions (commands / events) in tkinter's thread.
To show progress of an async function, submitted from tkinter, an async execution window widget is available,
which will display any text printed with the print()
function (or any stdout write requests).
.. code-block:: bash
pip install tkinter-async-execute
All documentation is available on https://tkinter-async-execute.readthedocs.io/.
.. code-block:: python
from tkinter import ttk
import tkinter as tk
import asyncio
import tk_async_execute as tae
async def async_function():
# Call tkinter widget methods.
print("Disabling button")
tae.tk_execute(bnt.config, state="disabled") # Thread safe exection
await asyncio.sleep(5)
print("Enabling button")
tae.tk_execute(bnt.config, state="normal")
await asyncio.sleep(2)
# Change tkinter text
print("Renaming button")
tae.tk_execute(bnt.config, text="Example 2")
await asyncio.sleep(2)
def button_clicked():
# Call async function
tae.async_execute(async_function(), wait=True, visible=True, pop_up=True, callback=None, master=root)
# Close application
root.quit()
if __name__ == "__main__":
root = tk.Tk()
bnt = ttk.Button(root, text="Click me", command=button_clicked, width=20)
bnt.pack()
tae.start() # Starts the asyncio event loop in a different thread.
root.mainloop() # Main Tkinter loop
tae.stop() # Stops the event loop and closes it.
FAQs
Simple library that allows interaction between Tkinter and asyncio event loop running in a seperate thread.
We found that tkinter-async-execute demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.