python : html 调用本地py

发布时间:2019-09-17 07:47:53编辑:auto阅读(2015)

    show_python.html

    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="gb2312">
        <title>python draw flowers</title>
    <script language="javascript">   
    function exec1 (command) {   
      var ws = new ActiveXObject("WScript.Shell");   
      ws.exec(command);   
    }   
    </script> 
      </head>
      <body>
        turtle 画一朵花    <a href="/python/draw_flower1.py" target="show"> 源代码 </a>  
        <input type="button" value="运行 python" οnclick="exec1('D:\\python27\\pythonw.exe D:/python/draw_flower1.py')" />
        <br/>
        turtle 画一朵玫瑰花 <a href="/python/draw_rose1.py" target="show"> 源代码 </a>  
        <input type="button" value="运行 python" οnclick="exec1('D:\\python27\\pythonw.exe D:/python/draw_rose1.py')" />
        <br/>
        turtle 画一朵西兰花 <a href="/python/draw_xilan1.py" target="show"> 源代码 </a>  
        <input type="button" value="运行 python" οnclick="exec1('D:\\python27\\pythonw.exe D:/python/draw_xilan1.py')" />
        <br/>
        <iframe name="show" id="show" width="800" height="500"/>    
      </body>
    </html>
    
    draw_flower1.py , draw_rose1.py , draw_xilan1.py 已打包成 test3.zip
    下载地址 http://download.csdn.net/download/belldeep/10267837
    

关键字