顯示具有 Python 標籤的文章。 顯示所有文章
顯示具有 Python 標籤的文章。 顯示所有文章

2010年10月16日 星期六

Hello world in Python


#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
第1行是為了給 Linux 相關的OS當Script所執行用的
第2行是為了告知Python要使用UTF-8的 encoding,
這樣才可以用中文的注解,並記得檔案存成UTF-8
'''

if __name__ == "__main__":
string1 = u"測試"
type1 = type(string1)
length1 = len(string1)
print "(%d-%s)%s"%(length1, type1, string1)

string2 = "測試"
type2 = type(string2)
length2 = len(string2)
print "(%d-%s)%s"%(length2, type2, string2)

2010年10月10日 星期日

安裝Python + Eclipse

1. Download Python for windows:

2. Python language for Eclipse plug-in :