首页 > 编程语言 > 详细

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

时间:2015-04-14 19:47:03      阅读:359      评论:0      收藏:0      [点我收藏+]


对于看见 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>


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

原文:http://blog.csdn.net/pandora_madara/article/details/45045997

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!