SlideShare a Scribd company logo
自由軟體程式設計入門 胡崇偉 [email_address] 自由軟體鑄造場 http://www.openfoundry.org/ 中央研究院 資訊科學研究所 軟體自由協會 http://www.slat.org/ Apr 26, 2008
自由軟體鑄造場簡介 營運  OpenFoundry  系統 專案管理服務 :  下載檔案 回報修改意見 通信討論 彙整學習資源及社群資訊 資源目錄 人才資料庫 電子報 推廣光碟 提供法律授權研究報告及諮詢 授權條款精靈 各國政策研究 進行校園演講研討會及國際交流
軟體自由協會簡介 宣揚軟體自由的理念 推廣自由軟體與開放源碼的使用和開發 參與校園自由軟體應用諮詢中心專案 舉辦  ICOS  研討會
為什麼要學程式語言 ? 培養解決問題的能力與技巧 數學家 工程師 藝術家 三種思惟的結合 增進對電腦系統的掌握並發揮其效能 找到動機就能事半功倍
學習電腦的好策略 找到學習動機並設定合理的目標 結合日常生活的應用情境 優先學習通用原則並長期投資 三人行必有我師 ( 身邊朋友助益最直接 ) ‏ 主動尋找社群同好 善用工具 ( 自由軟體是寶山 )
好工具助你快速上路 Python 下載及資訊網址 http://www.python.org/ http://www.python.org.tw/ Python 特色優點 易學易安裝 開放源碼免費在各式環境執行 原始碼易讀易管理
Python Shell >>>  是提示符號
Python  程式初體驗 print “hello world“ 9 + 7 - 6 5 * 4 / 2 3 ** 2 a = “3 x 3 =“ b = 3 * 3 print a, b
運算式的表達 3 * 3 == 3 ** 2 3 * 3 == 3 ** 3 if 3 * 3 == 3 ** 2: print “True!”
程式碼的撰寫與執行 #  代表註解符號 ,  表示之後的字串都是註解文字 ,  將不會被執行
迴圈運算 a = 3 while a > 0: print “count down”, a for a in 3,2,1: print “count down“, a
產生數列的工具 range(3)‏ for a in range(3): print “count down”, a for a in range(10,0,-1): print “count down“, a
顯示九九乘法表
錯誤訊息的處理
interable  例子 myString = ‘I Love Python’ myTuple = (‘I Love’, 7, 11) myList = [‘I Love’, 7, 11] 操作方式 :  索引運算 , 切片運算 myString[0] myList[0:2]
索引運算 n o h t y P e v o L I [ ] -1 ↓ -2 ↓ 7 -6 ↓ 2 ↓ 1 ↓ 0 ↓
載入其他功能 import math‏ math.sqrt(2) from math import sqrt sqrt(2) from math import *
function def myFunc(score): from math import sqrt a_score = sqrt(score)*10 return a_score
檔案讀取 file = open(“sample1.txt”, “r”)‏ lines = file.readlines() lines len(lines) for line in lines: print line
字串轉成數字 score = ’60’ math.sqrt(score) TypeError: a float is required import string string.atoi(score)
文字稿變成網頁 RestructuredText http://docutils.sourceforge.net/ 支援的格式 : HTML,XML,S5,LaTeX rst2html < myRST.txt > myRST.html
內容管理系統 Plone:  以  Python  寫成的網站軟體 http://plone.org/ 可下載  Windows Installer  輕鬆安裝使用 適合建置成知識管理網站
以  Zope  為基礎 內建的功能包括 網站伺服器 物件式資料庫 關連式資料庫 搜尋引擎 會員權限管理 工作流程管理 Scripting Content Template Object ZOPE Python Plone
管理介面 Zope Management Interface (ZMI) Root Folder  是最上層的目錄 使用者權限主要分兩類 : Manager, Member 帳號密碼管理 : acl_users 操作技巧 :  同時開啟兩種瀏覽器 以不同身份與權限來登入系統
網站設定
可新增的內容項目 Link Document NewsItem Event Image PowerPoint
Add Link  新增書籤
工作流程管理 Unauthorized User Published Contents Reviewer Author Publish Reject Pending Contents Private Contents View Edit Submit Retract
Ad

More Related Content

Similar to Introduction to Python Programming (20)

手把手教你 R 語言分析實務
手把手教你 R 語言分析實務手把手教你 R 語言分析實務
手把手教你 R 語言分析實務
Helen Afterglow
 
信息系统开发平台OpenExpressApp
信息系统开发平台OpenExpressApp信息系统开发平台OpenExpressApp
信息系统开发平台OpenExpressApp
zhoujg
 
漫談 Source Control Management
漫談 Source Control Management漫談 Source Control Management
漫談 Source Control Management
Wen-Shih Chao
 
软件工程
软件工程软件工程
软件工程
bill0077
 
Practical Data Analysis in R
Practical Data Analysis in RPractical Data Analysis in R
Practical Data Analysis in R
Chun-Ming Chang
 
[系列活動] 手把手教你R語言資料分析實務
[系列活動] 手把手教你R語言資料分析實務[系列活動] 手把手教你R語言資料分析實務
[系列活動] 手把手教你R語言資料分析實務
台灣資料科學年會
 
Practical data analysis in R: from data collection to data insight
Practical data analysis in R: from data collection to data insight Practical data analysis in R: from data collection to data insight
Practical data analysis in R: from data collection to data insight
Chun-Min Chang
 
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC#46_SQL Server 資料分析大躍進 Machine Learning ServicestwMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC
 
Python系列4
Python系列4Python系列4
Python系列4
數真 蔡
 
华为计算商业策略:硬件开放、软件开源、使能合作伙伴openGauss产品:商用+自用+开源相结合,内核将长期演进
华为计算商业策略:硬件开放、软件开源、使能合作伙伴openGauss产品:商用+自用+开源相结合,内核将长期演进华为计算商业策略:硬件开放、软件开源、使能合作伙伴openGauss产品:商用+自用+开源相结合,内核将长期演进
华为计算商业策略:硬件开放、软件开源、使能合作伙伴openGauss产品:商用+自用+开源相结合,内核将长期演进
blackangel52
 
2015 年逢甲大學資訊系:ASP.NET MVC 4 教育訓練5
2015 年逢甲大學資訊系:ASP.NET MVC 4 教育訓練52015 年逢甲大學資訊系:ASP.NET MVC 4 教育訓練5
2015 年逢甲大學資訊系:ASP.NET MVC 4 教育訓練5
Duran Hsieh
 
01 课程介绍与计算机系统概述
01 课程介绍与计算机系统概述01 课程介绍与计算机系统概述
01 课程介绍与计算机系统概述
Huaijin Chen
 
版本控制系统进阶
版本控制系统进阶版本控制系统进阶
版本控制系统进阶
killmyday
 
手把手打開Python資料分析大門
手把手打開Python資料分析大門手把手打開Python資料分析大門
手把手打開Python資料分析大門
Yen-lung Tsai
 
資訊證照講座
資訊證照講座資訊證照講座
資訊證照講座
Ryan Chung
 
基于Python的课堂在线辅助工具-- Piclass辅助教学系统_文欣秀.pptx
基于Python的课堂在线辅助工具-- Piclass辅助教学系统_文欣秀.pptx基于Python的课堂在线辅助工具-- Piclass辅助教学系统_文欣秀.pptx
基于Python的课堂在线辅助工具-- Piclass辅助教学系统_文欣秀.pptx
fdia1
 
Open Api&Sip
Open Api&SipOpen Api&Sip
Open Api&Sip
cenwenchu
 
自下而上的数据仓库构建方法
自下而上的数据仓库构建方法自下而上的数据仓库构建方法
自下而上的数据仓库构建方法
tongxiaojun
 
手把手教你 R 語言分析實務
手把手教你 R 語言分析實務手把手教你 R 語言分析實務
手把手教你 R 語言分析實務
Helen Afterglow
 
信息系统开发平台OpenExpressApp
信息系统开发平台OpenExpressApp信息系统开发平台OpenExpressApp
信息系统开发平台OpenExpressApp
zhoujg
 
漫談 Source Control Management
漫談 Source Control Management漫談 Source Control Management
漫談 Source Control Management
Wen-Shih Chao
 
软件工程
软件工程软件工程
软件工程
bill0077
 
Practical Data Analysis in R
Practical Data Analysis in RPractical Data Analysis in R
Practical Data Analysis in R
Chun-Ming Chang
 
[系列活動] 手把手教你R語言資料分析實務
[系列活動] 手把手教你R語言資料分析實務[系列活動] 手把手教你R語言資料分析實務
[系列活動] 手把手教你R語言資料分析實務
台灣資料科學年會
 
Practical data analysis in R: from data collection to data insight
Practical data analysis in R: from data collection to data insight Practical data analysis in R: from data collection to data insight
Practical data analysis in R: from data collection to data insight
Chun-Min Chang
 
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC#46_SQL Server 資料分析大躍進 Machine Learning ServicestwMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC#46_SQL Server 資料分析大躍進 Machine Learning Services
twMVC
 
华为计算商业策略:硬件开放、软件开源、使能合作伙伴openGauss产品:商用+自用+开源相结合,内核将长期演进
华为计算商业策略:硬件开放、软件开源、使能合作伙伴openGauss产品:商用+自用+开源相结合,内核将长期演进华为计算商业策略:硬件开放、软件开源、使能合作伙伴openGauss产品:商用+自用+开源相结合,内核将长期演进
华为计算商业策略:硬件开放、软件开源、使能合作伙伴openGauss产品:商用+自用+开源相结合,内核将长期演进
blackangel52
 
2015 年逢甲大學資訊系:ASP.NET MVC 4 教育訓練5
2015 年逢甲大學資訊系:ASP.NET MVC 4 教育訓練52015 年逢甲大學資訊系:ASP.NET MVC 4 教育訓練5
2015 年逢甲大學資訊系:ASP.NET MVC 4 教育訓練5
Duran Hsieh
 
01 课程介绍与计算机系统概述
01 课程介绍与计算机系统概述01 课程介绍与计算机系统概述
01 课程介绍与计算机系统概述
Huaijin Chen
 
版本控制系统进阶
版本控制系统进阶版本控制系统进阶
版本控制系统进阶
killmyday
 
手把手打開Python資料分析大門
手把手打開Python資料分析大門手把手打開Python資料分析大門
手把手打開Python資料分析大門
Yen-lung Tsai
 
資訊證照講座
資訊證照講座資訊證照講座
資訊證照講座
Ryan Chung
 
基于Python的课堂在线辅助工具-- Piclass辅助教学系统_文欣秀.pptx
基于Python的课堂在线辅助工具-- Piclass辅助教学系统_文欣秀.pptx基于Python的课堂在线辅助工具-- Piclass辅助教学系统_文欣秀.pptx
基于Python的课堂在线辅助工具-- Piclass辅助教学系统_文欣秀.pptx
fdia1
 
Open Api&Sip
Open Api&SipOpen Api&Sip
Open Api&Sip
cenwenchu
 
自下而上的数据仓库构建方法
自下而上的数据仓库构建方法自下而上的数据仓库构建方法
自下而上的数据仓库构建方法
tongxiaojun
 

More from TsungWei Hu (16)

Odoo Development
Odoo DevelopmentOdoo Development
Odoo Development
TsungWei Hu
 
開源教 教我 Odoo 管理 ERP 和 CRM
開源教 教我 Odoo 管理 ERP 和 CRM開源教 教我 Odoo 管理 ERP 和 CRM
開源教 教我 Odoo 管理 ERP 和 CRM
TsungWei Hu
 
Plone Zwiki
Plone ZwikiPlone Zwiki
Plone Zwiki
TsungWei Hu
 
Ten Years After: An Integrator's Tale
Ten Years After: An Integrator's TaleTen Years After: An Integrator's Tale
Ten Years After: An Integrator's Tale
TsungWei Hu
 
from passion import profession
from passion import professionfrom passion import profession
from passion import profession
TsungWei Hu
 
Computer Programming For Everyone
Computer Programming For EveryoneComputer Programming For Everyone
Computer Programming For Everyone
TsungWei Hu
 
ElasticSearch Introduction
ElasticSearch IntroductionElasticSearch Introduction
ElasticSearch Introduction
TsungWei Hu
 
Open Source Technologies for Contents and Maps
Open Source Technologies for Contents and MapsOpen Source Technologies for Contents and Maps
Open Source Technologies for Contents and Maps
TsungWei Hu
 
The Zen of Language Choice
The Zen of Language ChoiceThe Zen of Language Choice
The Zen of Language Choice
TsungWei Hu
 
Build Python CMS The Plone Way
Build Python CMS The Plone WayBuild Python CMS The Plone Way
Build Python CMS The Plone Way
TsungWei Hu
 
Plone -- Evolving Python CMS
Plone -- Evolving Python CMSPlone -- Evolving Python CMS
Plone -- Evolving Python CMS
TsungWei Hu
 
World Plone Day 2012 Taipei
World Plone Day 2012 TaipeiWorld Plone Day 2012 Taipei
World Plone Day 2012 Taipei
TsungWei Hu
 
Proud Plone on Cloud
Proud Plone on CloudProud Plone on Cloud
Proud Plone on Cloud
TsungWei Hu
 
Python - A Comprehensive Programming Language
Python - A Comprehensive Programming LanguagePython - A Comprehensive Programming Language
Python - A Comprehensive Programming Language
TsungWei Hu
 
Plone - A Comprehensive Content Management Solution
Plone - A Comprehensive Content Management SolutionPlone - A Comprehensive Content Management Solution
Plone - A Comprehensive Content Management Solution
TsungWei Hu
 
Developing with pyGTK in EeePC
Developing with pyGTK in EeePCDeveloping with pyGTK in EeePC
Developing with pyGTK in EeePC
TsungWei Hu
 
Odoo Development
Odoo DevelopmentOdoo Development
Odoo Development
TsungWei Hu
 
開源教 教我 Odoo 管理 ERP 和 CRM
開源教 教我 Odoo 管理 ERP 和 CRM開源教 教我 Odoo 管理 ERP 和 CRM
開源教 教我 Odoo 管理 ERP 和 CRM
TsungWei Hu
 
Ten Years After: An Integrator's Tale
Ten Years After: An Integrator's TaleTen Years After: An Integrator's Tale
Ten Years After: An Integrator's Tale
TsungWei Hu
 
from passion import profession
from passion import professionfrom passion import profession
from passion import profession
TsungWei Hu
 
Computer Programming For Everyone
Computer Programming For EveryoneComputer Programming For Everyone
Computer Programming For Everyone
TsungWei Hu
 
ElasticSearch Introduction
ElasticSearch IntroductionElasticSearch Introduction
ElasticSearch Introduction
TsungWei Hu
 
Open Source Technologies for Contents and Maps
Open Source Technologies for Contents and MapsOpen Source Technologies for Contents and Maps
Open Source Technologies for Contents and Maps
TsungWei Hu
 
The Zen of Language Choice
The Zen of Language ChoiceThe Zen of Language Choice
The Zen of Language Choice
TsungWei Hu
 
Build Python CMS The Plone Way
Build Python CMS The Plone WayBuild Python CMS The Plone Way
Build Python CMS The Plone Way
TsungWei Hu
 
Plone -- Evolving Python CMS
Plone -- Evolving Python CMSPlone -- Evolving Python CMS
Plone -- Evolving Python CMS
TsungWei Hu
 
World Plone Day 2012 Taipei
World Plone Day 2012 TaipeiWorld Plone Day 2012 Taipei
World Plone Day 2012 Taipei
TsungWei Hu
 
Proud Plone on Cloud
Proud Plone on CloudProud Plone on Cloud
Proud Plone on Cloud
TsungWei Hu
 
Python - A Comprehensive Programming Language
Python - A Comprehensive Programming LanguagePython - A Comprehensive Programming Language
Python - A Comprehensive Programming Language
TsungWei Hu
 
Plone - A Comprehensive Content Management Solution
Plone - A Comprehensive Content Management SolutionPlone - A Comprehensive Content Management Solution
Plone - A Comprehensive Content Management Solution
TsungWei Hu
 
Developing with pyGTK in EeePC
Developing with pyGTK in EeePCDeveloping with pyGTK in EeePC
Developing with pyGTK in EeePC
TsungWei Hu
 
Ad

Introduction to Python Programming