亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

 更新時間:2015年05月24日 16:47:34   投稿:goldensun  
這篇文章主要介紹了講解Python中fileno()方法的使用,是Python入門中的基礎(chǔ)知識,需要的朋友可以參考下

 fileno()方法返回所使用的底層實(shí)現(xiàn),要求從操作系統(tǒng)I/O操作的整數(shù)文件描述符。
語法

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

fileObject.fileno(); 

參數(shù)

  •     NA

返回值

此方法返回整數(shù)文件描述符。
例子

下面的例子顯示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()

當(dāng)我們運(yùn)行上面的程序,它會產(chǎn)生以下結(jié)果:

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

相關(guān)文章

最新評論