python2.7 thread 예제 코드
import thread, time
def counter(id):
for i in range(5):
print 'id %s --> %s' % (id, i)
time.sleep(1)
for i in range(5):
thread.start_new_thread(counter, (i,))
time.sleep(5)
print 'Exiting'
'Python' 카테고리의 다른 글
[python2.7] Multi-Thread 와 Multi-Processing 차이와 예제코드 (0) | 2013.08.04 |
---|---|
[python] exploit 코드들에서 자주 나오는 lambda 사용법으로 인한 pack 에 대한 이해 (0) | 2013.05.30 |
문자열 조합 방법 (brute forcing) (0) | 2013.04.07 |
[python]ZIP 파일 크랙 python 코드 (0) | 2013.03.26 |
[python 2.7] telnetlib를 이용한 telnet 접속하기 (0) | 2012.12.21 |