SoFunction
Updated on 2024-11-20

Explaining the use of the fileno method in Python

The fileno() method returns the underlying implementation used, requiring an integer file descriptor from the operating system I/O operation.
grammatical

The following is the syntax of the fileno() method:

(); 

parameters

  •     NA

return value

This method returns an integer file descriptor.
(for) instance

The following example shows the use of the fileno() method.

#!/usr/bin/python

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

fid = ()
print "File Descriptor: ", fid

# Close opend file
()

When we run the above program, it produces the following results:

Name of the file: 
File Descriptor: 3