def get_hostname(): import clr clr.AddReference('System.Windows.Forms') import System.Windows.Forms as forms return forms.Application.ProductName