怎么在django中引用自己的工程函数
6 回答

DIEA
TA贡献1820条经验 获得超2个赞
import threading# 这是你写的监控函数def monitor():
...
def control_monitor(enable):
with threading.Lock(): while enable:
monitor() if enable: return HttpResponse('开启完成') else: return HttpResponse('关闭完成')

qq_笑_17
TA贡献1818条经验 获得超7个赞
将stdout重定向到网页,可以将所有输出都显示到网页上。其实就是写一个类,例如写一个class html_out(这个类要有write和read函数,以模仿一个file),将sys.stdout输出重定向到html_out这个类上。html_out里面加一些函数处理一下输出,将输出转换成html的文本格式,然后返回到浏览器的请求上。类似这样的pytestlhj (dot) herokuapp (dot) com

偶然的你
TA贡献1841条经验 获得超3个赞
代码示例有逻辑的: 在A,B函数开始的位置加上标号A:和B: 然后在A函数中使用goto B跳到B函数执行;B函数执行完使用goto A返回到A函数 使用goto之后函数本身有没有退出 比如下面的语句 int A(){ goto A1; return 0; } A1: int B(){ }
- 6 回答
- 0 关注
- 476 浏览
添加回答
举报
0/150
提交
取消