2011年8月25日 星期四

Python File I/O 大蟒蛇 讀檔 寫檔





寫檔:
angryPow = open('angery-pow.log', 'w')
angryPow.write('angry pow is food-oriented!')
angryPow.close()




讀檔:

not-friendly-pow = open("/no-food/angry/angry-pow.log", "rb")
content = not-friendly-pow.read()



--------------------------------------------
每個蟒蛇人必備:
下載大蟒蛇 (Download python): http://www.python.org/getit/
--------------------------------------------
推薦編輯器 (Recommended Editor): 


死硬派程式家 (hard-core programmer)    
深紅,小狗 Crimson Editor http://www.crimsoneditor.com/english/download.html

懶懶熊  (Lazy programmer)
EasyEclipse: http://www.easyeclipse.org/site/distributions/python.html  (跟暮光之城無關)


----------------------------------------------


p.s. Lazy is not always bad in the context of programming.




沒有留言:

張貼留言