detecting the operating system

James Kew james.kew at
Sun Feb 29 00:18:30 CET 2004

"Michael" <mogmios at> wrote in message
news:mailman.253.1078007663.8594.python-list at
> Checking sys.platform is easy enough. I use it to figure out if I'm
> running on Linux or Windows. For Linux I take the users home directory
> to put files in. In Windows I check the registry to find out the
> location of My Documents and then save files there.

os.path.expanduser("~") ?


More information about the Python-list mailing list