Last active
          December 25, 2015 00:29 
        
      - 
      
- 
        Save shrunyan/6888181 to your computer and use it in GitHub Desktop. 
    Threading example in python
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import threading | |
| def worker(num): | |
| """thread worker function""" | |
| print 'Worker: %s' % num | |
| return | |
| threads = [] | |
| for i in range(5): | |
| t = threading.Thread(target=worker, args=(i,)) | |
| threads.append(t) | |
| t.start() | |
| print threads | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment