Skip to content

Instantly share code, notes, and snippets.

@andmerk93
Created February 15, 2024 14:24
Show Gist options
  • Save andmerk93/e52992d379a5f7ca68896d64f5b00fb7 to your computer and use it in GitHub Desktop.
Save andmerk93/e52992d379a5f7ca68896d64f5b00fb7 to your computer and use it in GitHub Desktop.
driverquery с выводом драйверов с типом File System
"""
Скрипт на Python, который будет запускать утилиту driverquery
с сохранением результатов в файл, а потом открывать этот файл
и выводить только драйвера с типом File System
Сделано в качестве тестового задания, 2024
"""
from csv import DictReader
from subprocess import Popen
from pprint import pprint
Popen(('driverquery /fo csv > drivers.csv'), shell=True)
with open('drivers.csv', 'r', encoding='utf-8', errors='ignore') as file:
for row in DictReader(file):
if 'File System' in str(row['Тип драйвера']):
pprint(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment