[Tutor] Re: import pwd?

Derrick 'dman' Hudson dman@dman.ddts.net
Thu, 11 Jul 2002 11:01:00 -0500


--bjuZg6miEcdLYP6q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Jul 10, 2002 at 05:18:18PM -0400, Timothy M. Brauch wrote:
| I have a problem.  The program runs on a windows computer and generates a
| log of anyone who logins.  I have a script that uses getpass, specificall=
y,
| getpass.getuser().  However, since I (re)installed Python 2.2 and VPython=
, I
| receive the following error:
|=20
| Traceback (most recent call last):
|   File "<pyshell#1>", line 1, in ?
|     import logger
|   File "c:\python22\programs\logger.pyw", line 35, in ?
|     user =3D getpass.getuser()
|   File "C:\PYTHON22\lib\getpass.py", line 101, in getuser
|     import pwd
| ImportError: No module named pwd
|=20
| So, where is pwd?

in POSIX ...

Microsoft operating systems originally didn't have the concept of
"multi-user".  Thus there was no 'pwd' module and no passwords.  More
recent incarnations have a semblance of multi-user, but are still
almost wholly incompatible with POSIX systems.

$ python2.2
>>> import pwd
>>> pwd.__file__
'/usr/lib/python2.2/lib-dynload/pwd.so'
>>>

You don't have 'pwd.so' on windows, and it wouldn't do you any good if
I sent it to you.

-D

PS. Ironically enough, POSIX stands for
    *Portable* Operating System Interface

--=20
=20
All a man's ways seem innocent to him,
but motives are weighed by the Lord.
        Proverbs 16:2
=20
http://dman.ddts.net/~dman/


--bjuZg6miEcdLYP6q
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAj0tq7wACgkQO8l8XBKTpRSoTgCeMKI+brTQGbs2KqsgQTTxBpHn
66gAoKbE9kCNj1QPTNJgQNreTH2/c2R3
=iSA2
-----END PGP SIGNATURE-----

--bjuZg6miEcdLYP6q--