Aahz Maruch aahz at
Mon Sep 18 18:01:19 CEST 2000

In article <8q5ako$9uj$1 at>,
Arild Hansen <arildh at> wrote:
>What is the exact purpose of fileno()? I keep searching for a good
>explanation of this function returning a file handler to an object,
>but what is the precise meaning and purpose of this? All help greatly
>appreciated !

As it says in the docs, it's for low-level access to file objects.  For
example, suppose you open a file in Python and want to access that file
in a C extension; you'd need to pass in f.fileno().  (There are
mechanisms for doing Pythonic access to the file in C, but it's a lot
simpler to just get the file handle.)
                      --- Aahz (Copyright 2000 by aahz at

Androgynous poly kinky vanilla queer het    <*>
Hugs and backrubs -- I break Rule 6

The best way to get information on Usenet is not to ask a question, but 
to post the wrong information.  --Aahz

More information about the Python-list mailing list