Example Usage of Threading in Python 2.1
I need some help implementing threading using Python 2.1. I would readily update to a newer version of Python, but unfortunately, I'm working within an interpreter built into a video game, so 2.1 is written in stone for me. To be clear, I need an example of how to do threading without using 'import threading'. 'import thread' is okay, but 开发者_开发知识库I can't get it to work right; usually it just locks up the game, when I try to spawn a new thread.
Alternatively, if someone could kindly explain to me where I might find this core 'threading' module, I might be able to incorporate that into a solution, because the examples I've read about how to use that module seem very straight-forward.
TIA
I'd recommend using the threading
module. If you don't have it, you can get the version from Python 2.1 here: http://pastebin.com/5f9NBmcg
Note that it imports thread
, so if your system has a problem with threads, it still won't work.
If you need specific modules from Python 2.1, go to the release page and click on one of the download links:
- Python-2.1.3.tgz - you can use
gunzip
, thentar
to extract the files - Python-2.1.3.exe - you can rename the file to put a
.zip
extentsion on it, then use your favorite ZIP utility to extract files.
精彩评论