1.简介:
ronPython 是一种在 NET 和 Mono 上实现的 Python 语言,由 Jim Hugunin(同时也是 Jython 创造者)所创造。Python,是一种面向对象的解释性的计算机程序设计语言,也是一种功能强大而完善的通用型语言,已经具有十多年的发展历史,成熟且稳定。Python 具有脚本语言中最丰富和强大的类库,足以支持绝大多数日常应用。这种语言具有非常简捷而清晰的语法特点,适合完成各种高层任务,几乎可以在所有的操作系统中运行。目前,基于这种语言的相关技术正在飞速的发展,用户数量急剧扩大,相关的资源非常多。
更多介绍:
http://baike.baidu.com/view/21087.htm
官方网站:
http://www.python.org/
2.安装:
首先需要安装开发环境,IronPython下载地址:http://download-codeplex.sec.s-msft.com/Download/Release?ProjectName=ironpython&DownloadId=423690&FileTime=129858605577070000&Build=20393,这个是2.73版本,下载下来一部一部就可以了
3.学习一:
开始>程序>IronPython Console(也就是安装根目录下的ipy.exe文件)弹出如下黑框:
print "hello world"就会显示hello world,如果我们输入
import this
会显示
The Zen of Python, by Tim Peters
Beautiful is better than ugly. 优美胜于丑陋
Explicit is better than implicit. 明了胜于晦涩
Simple is better than complex. 简单胜过复杂
Complex is better than complicated. 复杂胜过凌乱
Flat is better than nested. 扁平胜于嵌套
Sparse is better than dense. 间隔胜于紧凑
Readability counts. 可读性很重要
Special cases aren't special enough to break the rules. 即使假借特例的实用性之名,也不违背这些规则
Although practicality beats purity. 虽然实用性次于纯度
Errors should never pass silently. 错误不应该被无声的忽略
Unless explicitly silenced. 除非明确的沉默
In the face of ambiguity, refuse the temptation to guess. 当存在多种可能时,不要尝试去猜测
There should be one-- and preferably only one --obvious way to do it. 应该有一个,最好只有一个,明显能
做到这一点
Although that way may not be obvious at first unless you're Dutch.虽然这种 方式可能不容易,除非你是
python之父
Now is better than never. 现在做总比不做好
Although never is often better than *right* now. 虽然过去从未比现在好
If the implementation is hard to explain, it's a bad idea. 如果这个实现不容易解释,那么它肯定是坏主意
If the implementation is easy to explain, it may be a good idea. 如果这个实现容易解释,那么它很可能是
个好主意
Namespaces are one honking great idea -- let's do more of those! 命名空间是一种绝妙的理念,应当多加利
用
和一般的语言不同,在“hello world”程序开始之前,它还有一番人生哲学。
for i in range(1,10):
for j in range(1,i+1):
print str(i)+"*"+str(j)+'='+str(i*j)+' ',
print ' '