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