Python Threading Tutorials
(Note: This content was migrated from http://teyc.editthispage.com)
Python has a high level threading module, but there has never been much specific tutorials on how to use it.
Just to get you started, here’s a code example:
import thread
def background(param1, param2, param3):
print "Background thread called with %r %r %r" % (param1, param2, param3)
print "Thread ended"
thread.start_new_thread(background, ("a", "b", "c"))
# This is necessary as the background thread is still running when the main thread exits.
import time
time.sleep(2)
print "Main thread ended"
At the moment, the easiest path for anyone who wanted to play around with threading in Python has to first learn about threading through a Java tutorial and then figure out how it maps to Python threading classes.
- Microthreads on Inform IT
- Microthreads Tutorial by Will Ware – Thanks WayBackMachine!
- Faster IO with Python Threads Oscon presentation by Aahz Maruch – Thanks WayBackMachine!
If anyone has come across handy guides on python threading, would you please post a link here? Thanks.
About this entry
You’re currently reading “ Python Threading Tutorials ,” an entry on Chui's Counterpoint
- Published:
- 5.11.07 / 11pm
- Category:
- Python
1 Comment
Jump to comment form | comments rss [?] | trackback uri [?]