Skip to content

Extension of threading.Thread adding terminate method using Win32 API on Python

License

Notifications You must be signed in to change notification settings

sakurai-youhei/T800.winthread

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

T800.winthread

Extension of threading.Thread adding terminate method using Win32 API on Python

Build status

How to use added terminate method

Just replace your use of threading.Thread with T800.winthread.TerminatableThread.

from T800.winthread import TerminatableThread as Thread

t = Thread(target=run_forever)  # e.g. sys.stdin.read
t.start()

...

t.terminate()
# You can even exit here though t.setDaemon(True) was not called.

How to suppress annoying warning messages

import warnings
from T800.winthread import ThreadTerminationWarning

warnings.simplefilter("ignore", category=ThreadTerminationWarning)

What's T800?

Just Google it. :)

About

Extension of threading.Thread adding terminate method using Win32 API on Python

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages