classfile(object):def close(self): #real signature unknown; restored from __doc__

关闭文件"""close() -> None or (perhaps) an integer. Close the file.

Sets data attribute .closed to True. A closed file cannot be used for

further I/O operations. close() may be called more than once without

error. Some kinds of file objects (for example, opened by popen())

may return an exit status upon closing."""

def fileno(self): #real signature unknown; restored from __doc__

文件描述符"""fileno() -> integer "file descriptor".

This is needed for lower-level file interfaces, such os.read()."""

return0def flush(self): #real signature unknown; restored from __doc__

刷新文件内部缓冲区"""flush() -> None. Flush the internal I/O buffer."""

pass

def isatty(self): #real signature unknown; restored from __doc__

判断文件是否是同意tty设备"""isatty() -> true or false. True if the file is connected to a tty device."""

returnFalsedef next(self): #real signature unknown; restored from __doc__

获取下一行数据,不存在,则报错"""x.next() -> the next value, or raise StopIteration"""

pass

def read(self, size=None): #real signature unknown; restored from __doc__

读取指定字节数据"""read([size]) -> read at most size bytes, returned as a string.

If the size argument is negative or omitted, read until EOF is reached.

Notice that when in non-blocking mode, less data than what was requested

may be returned, even if no size parameter was given."""

pass

def readinto(self): #real signature unknown; restored from __doc__

读取到缓冲区,不要用,将被遗弃"""readinto() -> Undocumented. Don't use this; it may go away."""

pass

def readline(self, size=None): #real signature unknown; restored from __doc__

仅读取一行数据"""readline([size]) -> next line from the file, as a string.

Retain newline. A non-negative size argument limits the maximum

number of bytes to return (an incomplete line may be returned then).

Return an empty string at EOF."""

pass

def readlines(self, size=None): #real signature unknown; restored from __doc__

读取所有数据,并根据换行保存值列表"""readlines([size]) -> list of strings, each a line from the file.

Call readline() repeatedly and return a list of the lines so read.

The optional size argument, if given, is an approximate bound on the

total number of bytes in the lines returned."""

return[]def seek(self, offset, whence=None): #real signature unknown; restored from __doc__

指定文件中指针位置"""seek(offset[, whence]) -> None. Move to new file position.

Argument offset is a byte count. Optional argument whence defaults to

0 (offset from start of file, offset should be >= 0); other values are 1

(move relative to current position, positive or negative), and 2 (move

relative to end of file, usually negative, although many platforms allow

seeking beyond the end of a file). If the file is opened in text mode,

only offsets returned by tell() are legal. Use of other offsets causes

undefined behavior.

Note that not all file objects are seekable."""

pass

def tell(self): #real signature unknown; restored from __doc__

获取当前指针位置"""tell() -> current file position, an integer (may be a long integer)."""

pass

def truncate(self, size=None): #real signature unknown; restored from __doc__

截断数据,仅保留指定之前数据"""truncate([size]) -> None. Truncate the file to at most size bytes.

Size defaults to the current file position, as returned by tell()."""

pass

def write(self, p_str): #real signature unknown; restored from __doc__

写内容"""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."""

pass

def writelines(self, sequence_of_strings): #real signature unknown; restored from __doc__

将一个字符串列表写入文件"""writelines(sequence_of_strings) -> None. Write the strings to the file.

Note that newlines are not added. The sequence can be any iterable object

producing strings. This is equivalent to calling write() for each string."""

pass

def xreadlines(self): #real signature unknown; restored from __doc__

可用于逐行读取文件,非全部"""xreadlines() -> returns self.

For backward compatibility. File objects now include the performance

optimizations previously implemented in the xreadlines module."""

pass

python文件句柄_Python文件操作相关推荐

  1. python 文件管理_python 文件操作

    一.python中文件管理 文件管理是很多应用程序的基本功能和重要组成部分.Python可以使文件管理极其简单,特别是和其它语言相对比. 1.介绍 几乎以任何语言编写的众多应用程序中,文件管理是很重要 ...

  2. python删除文件某行_python 文件操作删除某行的实例

    python 文件操作删除某行的实例 使用continue跳过本次写循环就可以了 #文本内容 Yesterday when I was young 昨日当我年少轻狂 The tasting of li ...

  3. python 对 yaml 文件操作

    python 对 yaml 文件操作 #!/usr/bin/env python # -*- encoding: utf-8 -*- """ @Introduce : p ...

  4. Python实现tab文件操作

    Python实现tab文件操作 # -*- coding:gbk -*- import os class TABFILE:     def __init__(self, filename, dest_ ...

  5. python怎么读取文件-python怎么读写文件操作

    本节内容:I/O操作概述 文件读写实现原理与操作步骤 文件打开模式 Python文件操作步骤示例 Python文件读取相关方法 文件读写与字符编码 一.I/O操作概述 I/O在计算机中是指Input/ ...

  6. python处理excel教程实例-python 读写excel文件操作示例【附源码下载】

    本文实例讲述了python 读写excel文件操作.分享给大家供大家参考,具体如下: 对excel文件的操作,python有第三方的工具包支持,xlutils,在这个工具包中包含了xlrd,xlwt等 ...

  7. Python中的文件操作和异常

    Python中的文件操作和异常 文章目录 Python中的文件操作和异常 一.文件 01. 文件的概念 1.1 文件的概念和作用 1.2 文件的存储方式 文本文件和二进制文件 02. 文件的基本操作 ...

  8. Python os模块文件操作(二)

    Python os模块文件操作(二) os模块对文件夹和文件的操作很多.可以先看: https://blog.csdn.net/weixin_43790276/article/details/9867 ...

  9. Python os模块文件操作(一)

    Python os模块文件操作(一) 一.文件描述符 在使用代码对文件进行操作时,为了指定操作的文件,避免不了要使用文件描述符,所以我们先介绍什么是文件描述符. 操作系统为了高效管理已经被打开的文件, ...

最新文章

  1. 网站建设前的准备工作你了解多少?
  2. roast和roasting区别_《吐槽大会》的英文居然是roast!为什么?
  3. 中国电子银行网 神策数据:银行数字营销现状洞察报告
  4. 编程方法学16:数组
  5. 最常见的Java异常及其对Java开发人员的评价
  6. android第三方登录appid,AndroidQQ第三方登录
  7. 文件系统缓存dirty_ratio与dirty_background_ratio两个参数区别
  8. linux删除jpeg动态库,linux如何不用的删除动态库
  9. 视觉SLAM——ORB特征
  10. Ubuntu12.04编译Android4.0.1源码全过程-----附wubi安装ubuntu编译android源码硬盘空间不够的问题解决
  11. 打包图片上传cdn_Media Buy之Landing Page的资源文件CDN部署方案
  12. matlab浪漫画图,Matlab技巧11:谁说数学人不懂浪漫——Matlab画隐函数曲面
  13. Visio.2010.Premium.简体中文VOL版
  14. 技术干货 | 录屏采集实现教程 —— Android端
  15. mysql修改变量立即生效_mysql变量修改及生效
  16. PKU2506Tiling
  17. 2022年全球程序员收入报告出炉:国内程序员人均56w年薪。。网友说:我拖后腿了!...
  18. mmdetection3d debug 关键文件和断点
  19. 未对文件 C:\Users\Administrator\Documents\WindowsPowerShell\profile.ps1 进行数字签名。无法在当前系统上运行该脚本。
  20. Pytorch中维度dim的理解使用

热门文章

  1. 15-flutter Scaffold详解
  2. CoreText入坑一
  3. eclipse.ini内存设置
  4. 使用Node.js写一个简单的api接口
  5. 【git】git入门之把自己的项目上传到github
  6. 匿名类型和Object转换
  7. mysql-5.6 升级 5.7
  8. iOS App上架流程(2016详细版),真心很详细。
  9. iOS点击空白收回键盘
  10. 01-HTML基础与进阶-day6-录像281