Function Details: fileno

Description


Return the underlying file descriptor (an integer).


Extended Description


The fileno() method returns the file descriptor number for the file. File descriptors are small, non-negative integers used to represent opened files in UNIX-like systems.


Function Signature



Module: io

Class: TextIOWrapper

Parameters



Return


Returns an integer representing the file descriptor.


Return Type


int

Output

Explanation

This example demonstrates the basic usage of fileno(). It prints the file descriptor number for the opened file.