python os.open()和open()


os.open()返回為打開文件的描述符

f = os.open("test2.py", os.O_NONBLOCK)
print f # 結果為3

 

open()返回為文件對象

f = open("test.log", "wb")
print f # 結果為<open file 'test.log', mode 'wb' at 0x0000000002835030>

詳細介紹open():http://www.runoob.com/python/python-func-open.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM