• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >python > 讲解Python中fileno()方法的使用

讲解Python中fileno()方法的使用

作者:goldensun 字体:[增加 减小] 来源:互联网

goldensun 通过本文主要向大家介绍了python fileno,stdin fileno,fileno,stdout fileno,fileno函数等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

 fileno()方法返回所使用的底层实现,要求从操作系统I/O操作的整数文件描述符。
语法

以下是fileno()方法的语法:

fileObject.fileno(); 

</div>

参数

  •     NA

返回值

此方法返回整数文件描述符。
例子

下面的例子显示fileno()方法的使用。

#!/usr/bin/python

# Open a file
fo = open("foo.txt", "wb")
print "Name of the file: ", fo.name

fid = fo.fileno()
print "File Descriptor: ", fid

# Close opend file
fo.close()

</div>

当我们运行上面的程序,它会产生以下结果:

Name of the file: foo.txt
File Descriptor: 3

</div>

</div>

您可能想查找下面的文章:

  • 讲解Python中fileno()方法的使用

相关文章

  • python实现比较两段文本不同之处的方法
  • 如何在Python中编写并发程序
  • Python MySQLdb模块连接操作mysql数据库实例
  • Python中的lstrip()方法使用简介
  • python实现360的字符显示界面
  • python获取指定网页上所有超链接的方法
  • 好用的Python编辑器WingIDE的使用经验总结
  • python实现斐波那契数列的方法示例
  • 跟老齐学Python之Python安装
  • Python使用爬虫猜密码

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • Python正则表达式如何进行字符串替换实例
    • Python中bisect的用法
    • python使用reportlab画图示例(含中文汉字)
    • Python连接PostgreSQL数据库的方法
    • Python中最常用的操作列表的几种方法归纳
    • 解析Python中while true的使用
    • Python实现的飞速中文网小说下载脚本
    • python3实现ftp服务功能(服务端 For Linux)
    • python实现下载指定网址所有图片的方法
    • 视觉直观感受若干常用排序算法

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有