본문 바로가기
Python

uuid print

by 솥에 2013. 10. 28.
반응형

# -*- coding: cp949 -*-

'''

author: sote

date:2013-10-28

'''

import time

import uuid


def main():

    while True:

        '무한루프'

        time.sleep(1)

        '딜레이 1초'

        print uuid.uuid4()

        'uuid 출력'



if __name__=="__main__":

    try:

        main()

        'main 함수 호출'

    except KeyboardInterrupt:

        '키보드 인터럽트시 발생오류 패스'

        pass



''' 예외 처리를 안하면 Ctrl+C를 눌렀을 때 아래와 같은 에러 발생함.

Traceback (most recent call last):

  File "C:/Python27/t20131028.py", line 4, in <module>

    time.sleep(1)

KeyboardInterrupt'''


반응형