Skip to content

tkinter的异步版本,使tkinter可以运行或绑定async函数

License

Notifications You must be signed in to change notification settings

WSitong/asynctk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

asynctk

tkinter的异步版本,使tkinter可以运行或绑定async函数


from asynctk import *

async def main():
    async def hello():
        btn.config(text='running', state='disabled')
        await asyncio.sleep(2)
        btn.config(text='ok', state='disabled')
        await asyncio.sleep(1)
        btn.config(text='start', state='normal')

    root = AsyncTk()
    btn = Button(root, text='start', command=normal(hello))
    btn.pack()
    await root.mainloop()

asyncio.run(main())

About

tkinter的异步版本,使tkinter可以运行或绑定async函数

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages