神器 Brython —— 将 python 当做客户端脚本使用

来源:互联网 发布:淘宝手机版海报尺寸 编辑:程序博客网 时间:2024/06/05 12:04


对于看见 JS 代码就很痛苦的我来说,Brython 就像是福音,希望它发展顺利!


<html>    <head>        <script src="brython.js"></script>    </head>    <body onLoad="brython()">        <script type="text/python">            from browser import document, alert            import math             alert( "Hello World" )            def func( ev ):                alert( document["in"].value )            document["click"].bind( "click", func )                </script>        <input id="in"><button id="click">click</button>    </body></html>


1 0
原创粉丝点击