惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
Intezer
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
AWS News Blog
AWS News Blog
G
GRAHAM CLULEY
P
Privacy & Cybersecurity Law Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
N
News | PayPal Newsroom
T
Tenable Blog
Spread Privacy
Spread Privacy
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
P
Privacy International News Feed
IT之家
IT之家
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
博客园_首页
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
NISL@THU
NISL@THU
I
InfoQ
D
DataBreaches.Net
有赞技术团队
有赞技术团队
K
Kaspersky official blog
Security Latest
Security Latest
The Register - Security
The Register - Security
Hugging Face - Blog
Hugging Face - Blog
S
Security @ Cisco Blogs
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AI
AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
N
News and Events Feed by Topic

Python | 酷 壳 - CoolShell

Python修饰器的函数式编程 | 酷 壳 - CoolShell 函数式编程 | 酷 壳 - CoolShell 二叉树迭代器算法 | 酷 壳 - CoolShell 一些有意思的算法代码 | 酷 壳 - CoolShell Python 和 PyGame 的一些示例 | 酷 壳 - CoolShell 五大基于JVM的脚本语言 | 酷 壳 - CoolShell Python处理encoding的小技巧 | 酷 壳 - CoolShell Python程序员的进化 | 酷 壳 - CoolShell 如何使用Python操作摄像头 | 酷 壳 - CoolShell 非常简单的Python HTTP服务 | 酷 壳 - CoolShell Erlang和Python互通 | 酷 壳 - CoolShell Python也Spring了 | 酷 壳 - CoolShell Python 自然语言处理 | 酷 壳 - CoolShell 用TCC可以干些什么? | 酷 壳 - CoolShell
在Javascript里写Python | 酷 壳 - CoolShell
陈皓 · 2010-07-21 · via Python | 酷 壳 - CoolShell

以前,本站介绍过去一种写HTML和CSS的新方法,以一种杂交式的代码,昨天给大家介绍了.NET代码和Python及Ruby代码的互相转换工具,但是这个世界可能比我们想像的还疯狂。IronPython 是一个在.NET平台上运行Python的东西,就像那些在JVM上运行其它语言的东东一样。当然,IronPython最邪恶的事情并不是在.NET上运行Python,而是在Javascript里写Python的语法。这个畸形混血儿的网址在这里(请注意翻墙)。

使用这个玩意很简单,下面,让我们看看这个混血儿长啥样?

首先,你需要链接一个js文件:

<script src="http://gestalt.ironpython.net/dlr-latest.js" type="text/javascript"></script>

然后,让我们看看如何写一个按钮事件:

<input id="button" type="button" value="Say, Hello!" />
<script type="text/python">
  def button_onclick(s, e):
      window.Alert("Hello from Python!")
  document.button.events.onclick += button_onclick
</script>

你对此事怎么看?欢迎留下你的看法。

Loading...