Feb
12
12
# Threading in Python
Henceforth all posts regarding a certain programming language shall be denoted in the title using comments specific to that language. This is for visual purposes, as well as for fun.
Threading in Python
Setting up separate threads is incredibly easy in Python. There are several tutorials out there suggesting one subclass the threading.Thread class and override the run method, but this is not necessary. Simply do the following:
import threading
def func():
# ... some code here
pass
new_thread = threading.Thread(target=func)
new_thread.start()
This will run func in a new thread. Interacting threads is a bit trickier, but I refuse to write anything about that until I know something about it.
Leave a comment
Tags
Apple
Business
Critique
css
dell
Design
Design Patterns
facebook
firefox
Gmail
google
Hotmail
Interface
javascript
laptop
Links
Linux
Mac
Microsoft
netbook
OpenGL
OS
Philosophy
PHP
Podcast
Programming
Pyglet
Python
Pythonic Programming
Review
Search
services
Symfony
Time Management
Tutorial
Tutorials
Twitter
ubiquity
Ubuntu
update
Version Control
web design
Windows
Windows 7
Windows Mobile

