Linux下首行一定要加這句話:!/usr/bin/Python,!/usr/bin/Python是告訴操作系統(tǒng)執(zhí)行這個(gè)腳本的時(shí)候,調(diào)用/usr/bin下的python解釋器。不加的話會報(bào)錯(cuò),windows下倒不用。
參考文章:http://blog.csdn.net/wh_19910525/article/details/8040494
參考文章:http://blog.csdn.net/wh_19910525/article/details/8040494
2017-06-02
for line in f 就行了,python專門為for關(guān)鍵字做了迭代器的語法糖。在for循環(huán)中,Python將自動調(diào)用工廠函數(shù)iter()獲得迭代器,自動調(diào)用next()獲取元素,還完成了檢查StopIteration異常的工作。。。
2017-05-28
花了一個(gè)多小時(shí)看完了,講的還可以,聽起來基本沒障礙,因?yàn)橹饕菙?shù)據(jù)的處理,文件的讀取還是有用的,當(dāng)然這個(gè)里面沒講數(shù)據(jù)處理,很好啦畢竟免費(fèi),感謝老師了
2017-05-25
help(f.write)
write(...)
write(str) -> None. Write string str to file.
Note that due to buffering, flush() or close() may be needed before
the file on disk reflects the data written.
養(yǎng)成help一下的好習(xí)慣
write(...)
write(str) -> None. Write string str to file.
Note that due to buffering, flush() or close() may be needed before
the file on disk reflects the data written.
養(yǎng)成help一下的好習(xí)慣
2017-05-07
注意了,Python工具大全集來了,內(nèi)含各種包,集成開發(fā)環(huán)境,包括IPython,請叫我雷鋒
https://www.continuum.io/downloads
https://www.continuum.io/downloads
2017-04-25