Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
check the browser existence one by one
from win32com.client import Dispatch def get_version_via_com(filename): try: parser = Dispatch('Scripting.FileSystemObject') version = parser.GetFileVersion(filename) return version except: return 'F' if __name__ == '__main__': path = {} browser = '' path['chrome0'] = r'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' path['chrome1'] = r'C:\Program Files\Google\Chrome\Application\chrome.exe' path['firefox0'] = r'C:\Program Files (x86)\Mozilla Firefox\firefox.exe' path['firefox1'] = r'C:\Program Files\Mozilla Firefox\firefox.exe' path['ie'] = r'C:\Program Files\Internet Explorer\iexplore.exe' for key,value in path.items(): if key == 'chrome0': if get_version_via_com(value) != 'F': browser = 'chrome' break if key == 'chrome1': if get_version_via_com(value) != 'F': browser = 'chrome' break else:continue elif key == 'firefox0': if get_version_via_com(value) != 'F': browser = 'firefox' break else:continue elif key == 'firefox1': if get_version_via_com(value) != 'F': browser = 'firefox' break else:continue elif key == 'ie': if get_version_via_com(value) != 'F': browser = 'ie' break else:continue else: continue print(browser)
run
|
edit
|
history
|
help
0
Q2
Itc
Select fruits
Calculator
ванечка с тебя 200 рублей, жду мой сладкий 🤑
Hi.py
PySlots2
try123
Program of cube
fb_series