import subprocess # traverse the software list Data = subprocess.check_output(['wmic', 'process', 'list', 'brief']) a = str(Data) # try block # arrange the string try: for i in range(len(a)): a = a.split('\\r\\r\\n') for i in a: i = i.split() #print(i[1]) #name #print(i[2]) #print(i[3]) #process ID print(i[4]) #thread count #print(i[5]) #working setsize except IndexError as e: print("All Done")