用Django运行python脚本

时间:2017-03-09 03:54:57

标签: python html django

我需要运行这个简单的python脚本并在html中显示输出。 我怎么在django做这个? 这是脚本

import urllib

r='http://c.lo.com/cl/PHP/grweather.php'
openurl= urllib.urlopen(r)
readurl= openurl.read()


date= readurl[10:20]
humidity= readurl[62:66]
temperature= readurl[83:87]
windspeed= readurl[136:140]

print(date, humidity, temperature, windspeed)

提前感谢:)

0 个答案:

没有答案
相关问题