I have a couple Windows computers on my network that will be running a python script. A different set of configuration options should be used in the script depending on which c
Since the python scrips are for sure running on a windows system, you should use the Win32 API GetComputerName or GetComputerNameEx
You can get the fully qualified DNS name, or NETBIOS name, or a variety of different things.
import win32api
win32api.GetComputerName()
>>'MYNAME'
Or:
import win32api
WIN32_ComputerNameDnsHostname = 1
win32api.GetComputerNameEx(WIN32_ComputerNameDnsHostname)
>> u'MYNAME'