The format of filename

Leif K-Brooks eurleif at
Tue Oct 24 16:49:55 CEST 2006

Neil Cerutti wrote:
> Where can I find documentation of what Python accepts as the
> filename argument to the builtin function file?

Python will accept whatever the OS accepts.

> As an example, I'm aware (through osmosis?) that I can use '/' as
> a directory separator in filenames on both Unix and Dos. But
> where is this documented?

It's documented in the OS's documentation. It can be queried with os.sep 
and os.altsep.

More information about the Python-list mailing list