首页 > 编程语言 > 详细

python 中time.sleep没有作用

时间:2016-05-24 20:52:42      阅读:1095      评论:0      收藏:0      [点我收藏+]

很简单的一个程序:

# -*- coding: utf-8 -*-

import MySQLdb,os,json,time
#from wsgiref.simple_server import make_server
from cgi import parse_qs, escape
import sys

def checkCompany(keyword = None):
    row = None

    if row is None:
        for i in range(10):
            print(i, flush=True)
    else :
        return True
    time.sleep(10)
    return end


if __name__ == __main__:
    return_body = checkCompany()

    if return_body is None:
        return json.dumps([{data:123}])
    else: 
        return return_body

但是根本就没有起作用time.sleep

The actual suspension time may be less than that requested because any caught signal will terminate the sleep() following execution of that signal’s catching routine.

python 中time.sleep没有作用

原文:http://www.cnblogs.com/zl0372/p/5524574.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!