-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathtest3.html
More file actions
39 lines (31 loc) · 982 Bytes
/
test3.html
File metadata and controls
39 lines (31 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<script language="javascript">
function exec1(command) {
var ws = new ActiveXObject("WScript.Shell");
ws.run(command);
}
</script>
</head>
<body>
<div id="header">
<h1>读取python运行的结果</h1>
</div>
<!-- 按键开始执行python程序 -->
<div id="program1">
执行test3程序(方式1)
<button onclick="exec1('python test3.py')">运行 python</button>
</div>
<div id="program2">
执行test3程序(方式2)
<input type="button" value="运行 python" onclick="exec1('python test3.py')" />
</div>
<!-- 读取python运行结果 -->
<!-- 链接的 target 属性必须引用 iframe 的 name 属性 -->
<div id="result">
<p><a href="number.txt" target="result">结果</a></p>
<iframe name="result" width="100" height="30" scrolling="no" frameborder="3"></iframe>
</div>
</body>
</html>