Run Cmd

Forums:

def getip(): try: stream=os.popen('hostname') hst=stream.read() stream=os.popen('hostname -I ') hip = stream.read() return "host={0},ip={1}".format(hst.replace(' ',''),hip.replace(' ','') except: return 'NA,NA'