Python代码:
@app.route('/history')
def history():
return render_template('history.html')
Html代码:
<!DOCTYPE html>
<html lang="en">
<head>
<h2>History</h2>
<meta charset="utf-8">
<style>
table {
border-collapse: collapse;
border: 2px black solid;
font: 12px sans-serif;
}
td {
border: 1px black solid;
padding: 5px;
}
</style>
</head>
<body>
<!-- <script src="http://d3js.org/d3.v3.min.js"></script> -->
<script src="d3min.js?v=3.2.8" href="{{ url_for('static', filename='d3min.js') }}""></script>
<script type="text/javascript"charset="utf-8">
d3.text("output.csv", function(data) {
var parsedCSV = d3.csv.parseRows(data);
var container = d3.select("body")
.append("table")
.selectAll("tr")
.data(parsedCSV).enter()
.append("tr")
.selectAll("td")
.data(function(d) { return d; }).enter()
.append("td")
.text(function(d) { return d; });
});
</script>
</body>
</html>
和csv文件:
15.3C 94.90% 7/3/2017 1:29
15.2C 94.90% 7/3/2017 1:59
14.8C 94.90% 7/3/2017 2:29
14.7C 95.00% 7/3/2017 2:59
14.8C 95.00% 7/3/2017 3:29
14.8C 95.00% 7/3/2017 3:59
14.6C 95.00% 7/3/2017 4:29
14.8C 95.00% 7/3/2017 4:59
14.5C 95.00% 7/3/2017 5:29
14.8C 95.00% 7/3/2017 5:59
14.1C 95.00% 7/3/2017 6:29
14.4C 95.00% 7/3/2017 6:59
16.0C 90.80% 7/3/2017 7:29
16.4C 90.00% 7/3/2017 7:59
17.2C 89.90% 7/3/2017 8:29
18.1C 87.20% 7/3/2017 8:59
我正在尝试在烧瓶中显示.csv文件,该文件与html文件位于同一位置,但未显示其内容。 csv中的值以逗号分隔。如果我在firefox中打开历史记录页面,没有flask服务器,它会在表格中显示值。
答案 0 :(得分:0)
问题解决了:
<?php
error_reporting(E_ALL);
ini_set("display_errors","On");
$excel = new COM("Excel.application",,) or die ("ERROR: Unable to
instantaniate COM!\r\n");
print_r(get_loaded_extensions());
?>