Answer the question
In order to leave comments, you need to log in
How to view all installed programs on the computer and the paths to them, and then write them into the dictionary?
I am writing a voice assistant. I need to transfer it to another device, but the problem is that I wrote down the paths to the programs that the assistant opens on command. I need to find out all installed programs on the computer and record the name and path of this program in a dictionary. I tried to do it with "Winapps" library like this:
import winapps
for app in winapps.list_installed():
print(app)
Answer the question
In order to leave comments, you need to log in
import os
soft_list = []
#64-bit
for lf in os.listdir('C:\\Program Files'):
if not os.path.file(lf):
soft_list.append(lf)
#32-bit
for lf in os.listdir('C:\\Program Files (x86)'):
if not os.path.file(lf):
soft_list.append(lf)
for sl in soft_list:
print(sl)
list_installed() to the dictionary is redone at the moment
a '5/6/2020' does not match format '%Y%m%d'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question