如何在HTA应用程序中运行python

2024-09-28 20:44:48 发布

您现在位置:Python中文网/ 问答频道 /正文

如何在HTA应用程序中运行python。在

OS=Windows 8.1版

Python=ActivePython-2.7.10.12-win64-x64

<html>
<head>
<title>demo</title>
</head>
<body>
<form name=fom1>
<input type=button name=b1 value=add onclick=s1()><br>
<input type=button name=b2 value=add onclick=d1()><br>
<input type=button name=b3 value=add onclick=f1()><br>
</form>

<script language=vbscript>
sub s1
msgbox "from vbscript"
end sub
</script>

<script language=python>
alert("hi");

def d1():
    alert("from python");

</script>

<script language=jscript>
function f1(){
    alert("from jscript");
}
</script>
</body>
</html>

这是我现在的准则。vbscript和jscript可以工作。但是python代码似乎没有运行。当我点击b2时,我得到一个错误消息:“属性d1的值为null或未定义。”


Tags: namefrombraddinputvaluetypescript