Mais conteúdo relacionado Semelhante a Python meetup 1 (20) Python meetup 13. Installation
Python 2.7 or Python 3.4
https://www.python.org/downloads
Sublime Text 2 - editor with building system
http://www.sublimetext.com/2
pip - python package index (package manager)
http://www.pip-installer.org/en/latest/installing.html
git - version control (optional)
http://git-scm.com/
7. Why using Python?
軟體品質 - 可讀性佳、縮排取代⼤大括號、Object-Oriented、別⼈人
寫出來的code⽐比較容易看懂
⽣生產⼒力 - 相對於C++, Java 程式碼的量⼤大約1/3, 1/5
可移植性 - 不同作業平台上可以使⽤用
程式庫 - 最⼤大的好處之⼀一,許許多多的輪⼦子
整合其他語⾔言 - 其他語⾔言平台可以port,例如Iron Python, Jyphon
好吃、新奇、⼜又好玩
9. 從功能性來看
動態定型 - Python 會記錄程式執⾏行時的物件種類,不⽤用宣告複雜的形態跟
⼤大⼩小
⾃自動記憶體管理 - 當物件不再使⽤用時,啟動GC,會記錄低階記憶體細節,
總之我們不⽤用擔⼼心
⽀支援⼤大型程式設計 - 可以分⾨門別類的來寫code,整合起來相對⽅方便
內建物件型態 - [], {}, ()…
內建⼯工具 - 類似C++的STL
程式庫公開⼯工具 - 最⼤大的好處之⼀一
協⼒力廠商公⽤用程式
13. <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>__URL__</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>__BUNDLEID__</string>
<key>bundle-version</key>
<string>__BUNDLEVER__</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>__TITLE__</string>
</dict>
</dict>
</array>
</dict>
</plist>
14. import xml.etree.cElementTree as ET
import sys
!
BUNDLEID = '__BUNDLEID__'
bundle_identifier = 543
!
tree = ET.ElementTree(file='default.plist')
!
root = tree.getroot()
!
for i in tree.iter(tag='string'):
if i.text == BUNDLEID:
i.text = str(bundle_identifier)
!
tree.write(sys.stdout)