zl程序教程

您现在的位置是:首页 >  后端

当前栏目

python之函数用法file()

Python 函数 用法 File
2023-09-11 14:17:15 时间
# -*- coding: utf-8 -*-
#python 27
#xiaodeng
#python之函数用法file()



#file()
#说明:file()内建函数它的功能等于open(),但是可以看出,他是个文件工厂(生成文件对象),dict()生成字典对象
#包含与被包含的关系
'''
file(...)
    file(name[, mode[, buffering]])#buffering是缓冲相关的可选参数
    
    Return the binary representation of an integer or long integer.
'''

html=file('test.txt','r')
print html.read()