DedInc / pythread

A Python library providing a user-friendly interface for managing both synchronous and asynchronous threads.

Home Page:https://pypi.org/project/pythread

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pythread - Useful module for comfortable managing with threading.


-How to use-

import pythread as pt

def func(a, b):
    print(a, b)

t = pt.createThread('NameOfThread', func, 5, 'a', 'b') #NameOfThread - name of thread, func - function, 5 - delay of run function, 'a', and 'b' arguments of function
t.start() #start the thread

pt.stopThread('NameOfThread') #stop thread by name
pt.stopThread(t) #stop thread by thread
t = ptr.getThreadByName('NameOfThread') #select thread by name

About

A Python library providing a user-friendly interface for managing both synchronous and asynchronous threads.

https://pypi.org/project/pythread

License:MIT License


Languages

Language:Python 100.0%