我用python创建了一个仪表板。我需要对html页面进行一些修饰性的更改。在
我研究了turtle
和{
#!/usr/local/bin/python
import requests
import json
import datetime
import sys
import os
from html import HTML
todayDate=datetime.date.today().strftime("%Y-%m-%d")
h=HTML('html','')
p=h.p('DETAILS for ',' ', todayDate)
t=h.table(border='1')
r=t.tr()
r.td('Import Timestamp')
r.td('JobId')
r.td('Status')
r.td('RecordsProcessed')
r.td('RecordsFailed')
r.td('FileName')
r.td('Duration')
r.td('Throughput')
print '\n'
def genHTMLforImportSuccess():
responseurl = requests.get(url)
if(responseurl.ok):
jData = json.loads(responseurl.content)
if jData > 0:
for responseurl in jData['response']:
starttime=responseurl['statistics']['startTime']
jobId= responseurl['jobId']
status = responseurl['status']
recordsProcessed=responseurl['statistics']['recordsProcessed']
recordsFailed=responseurl['statistics']['recordsFailed']
fileName=responseurl['fileName']
duration=responseurl['statistics']['duration']
throughput=responseurl['statistics']['throughput']
print '\n'
r=t.tr()
r.td(str(starttime))
r.td(str(jobId))
r.td(str(status))
r.td(str(recordsProcessed))
r.td(str(recordsFailed))
r.td(str(fileName))
r.td(str(duration))
r.td(str(throughput))
print '\n'
else:
print "No data feed"
else:
responseurl.raise_for_status()
genHTMLforImportSuccess()
print h
非常感谢任何帮助
我在 从html导入html
^{pr2}$却得不到想要的结果如何我能修好这个吗
目前没有回答
相关问题 更多 >
编程相关推荐