[Tutor] Interpreter Conflicts with os.access
Michael P. Reilly
arcege@shore.net
Mon, 5 Feb 2001 21:45:58 -0500 (EST)
>
> Hi:
> <duh>Confused Newbie Here:
> Am using Python on RH 6.0.
> Have both python1.5 and python2.0
> When I invoke python 1.5, I receive an AttributeError
> when calling os.access.
>
> When I invoke python 2.0, os.access is processed correctly.
> Sure enough, there is no function named "access" in /usr/lib/python1.5/access.py
> That's no suprise, but when I look at /usr/local/lib/python2.0/os.py
> I can't find the subroutine there either.
>
> As a newbie, I'm confused: Could someone explain this discrepancy to me
> and let me know what I am doing incorrectly. </duh>
This function and most of the others in the os module (running on a
UNIX/POSIX system) come from the "posix" built-in module.
$ python
Python 1.5.2 (#1, Aug 25 2000, 09:33:37) [GCC 2.96 20000731 (experimental)] on linux-i386
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import os
>>> import posix
>>> os.access is posix.access
1
>>>
About the only difference is that this is RedHat 7. You might like to
read the os.py module to see how this is accomplished.
-Arcege
--
------------------------------------------------------------------------
| Michael P. Reilly, Release Manager | Email: arcege@shore.net |
| Salem, Mass. USA 01970 | |
------------------------------------------------------------------------