Re: import posix

Steven D. Majewski (sdm7g@elvis.med.virginia.edu)
Wed, 3 Aug 1994 17:28:09 -0400

On Aug 3, 17:01, "David N. Richards" wrote:
>
> Hello All - I noticed that module poisixpath.py begins
> with an 'import posix' statement but I searched through
> the Lib and can't find any module by that name (posix.py). Yet when
> I write code that utilizes this everything works fine.
> Is this built into the python binary?

Yes.
As are mac and dos modules on those platforms.

"import os" is the recommended portable way if you want code
to be os independent. module os will actually be the appropriate
one. If you REQUIRE posix, then use "import posix" , which will
raise an error if it fails. ( Unfortunately, for historical
reasons, I don't think you can't reply on that meaning you
have the full posix module. The dosmodule is really the posixmodule
with most of the unix/posix specific functions commented out. )

See previous "newbie" post on how to use os & os.path portably.

- Steve Majewski (804-982-0831) <sdm7g@Virginia.EDU>
- UVA Department of Molecular Physiology and Biological Physics