Skip to main content

Run Tkinter module with own code at the same time

Project description

TkinterAsync

Run Tkinter Tcl/Tk Python module with own loop code at the same time.

For more info Github - https://github.com/ZhengLinLei/tkinterAsync Issues Github - Issues

Example code:

import sys
import os.path
sys.path.append(
    os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))


from src.tkinterAsync import Tkinter

# TKINTER GUI
def gui(root, tk, ttk):
    root.title('Title example')
    root.geometry('300x300')

    root.resizable(0, 0)

    button = tk.Button(root, text = 'Alert', padx = 25, cursor = 'hand2', command = lambda : print('Hello World!'))
    button.place(relx=0.5, rely=0.5, anchor=tk.CENTER)




# CREATE VARIABLE
root = Tkinter(gui) # PASS THE FUNCTION OR METHOD CLASS




# AFTER RUNNING TKINTER, THE PYTHON MUST RUN THE CODE BELOW AT THE SAME TIME

print('Running this after Tkinter')

for i in range(1000):
    print(i)

Zheng Lin Lei Github - 2021

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tkinterAsync-1.0.0.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

tkinterAsync-1.0.0-py3-none-any.whl (5.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page