Hiding stuff like passwords in source?

nobody root at [127.0.0.1]
Sun Dec 9 01:52:46 EST 2001


> Can't protect them from prying eyes covers a lot of UNIX platforms.
> It's more like "don't" than "can't" - enviroment variables just aren't
> subject to any kind of access control, and if you think "well, they

Eep!

> should be!", I suppose next you won't want us to be able to see your
> commands and parameters, etc.

Well then replace the if os.getenv() bit with a test for an external file,
if it exists import it's contents.  The important thing is to put the
'constants' at the top so they're easily seen, and properly protect the more
complex code lower down so if a file doesn't exist etc. it doesn't crash.






More information about the Python-list mailing list