![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveRe: How to get computer name
From: Tim Heaney <theaney@cablespeed.com>
Date: Sat Apr 29 2006 - 18:57:47 CEST
"pitarda" <pitarda@gmail.com> writes:
> How do I get the computer name in python?
You can use the os module to get it from your environment.
>>> import os
Depending on your operating system, the environment variable you need
>>> os.getenv('COMPUTERNAME')
You can see all of the environment variables currently available with
>>> os.environ
I hope this helps,
Tim
|