python 中time.sleep没有作用
2016-05-24 19:29
405 查看
很简单的一个程序:
但是根本就没有起作用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.
# -*- 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 Tricks(十三)—— 欧几里得算法
- Python读取中文txt文件错误:UnicodeEncodeError: 'gbk' codec can't encode character
- Python Tricks(十二)—— 有理数的加法
- 简明 Python 教程
- IPython 与 Jupyter
- BZOJ 1213 Python... 二分+高精度
- 用PYTHON写一个应用程序并发布exe
- Python的for和break循环结构中使用else语句的技巧
- python类的静态方法和类方法区别
- Python Tricks(十一)—— 阶乘的实现
- Python 编码规范
- python 中time, datetime的用法
- Python静态方法的使用
- python 中的字符串转义序列、字符串格式化、操作符、关键字总结
- python脚本判断一个数是否为素数的几种方法
- Python-Matplotlib安装及简单使用
- 计蒜客难题题库之二 奇怪的国家 python解答
- Python 文件迭代器
- leetcode 137. Single Number II-寻找单身狗
- python解析发往本机的数据包示例 (解析数据包)