pywin32
COM
Windows
Получение имени процесса активного окна
def get_process_name():
# получаем id активного окна
hdlr = win32gui.GetForegroundWindow()
# получаем id процесса с помощью id окна
pid = win32process.GetWindowThreadProcessId(hdlr)
# получаем список всех активных процессов с помощью модуля psutil
processes = psutil.pids()
# ищем наш процесс ps
for p in processes:
if p == pid[1]:
# нашли его, получаем этот процесс и возвращаем его имя
process = psutil.Process(p)
return process.name()
{%hackmd theme-dark %} https://stackoverflow.com/questions/3718037/error-while-working-with-excel-using-python
Feb 8, 2022{%hackmd theme-dark %} [TOC] Python Правила оформления кода COM erroe wrapper Работа с AutoCAD Подключение к AutoCAD
Jun 26, 2021{%hackmd theme-dark %} ! не проверено Если AutoCAD не занят построениями/вычислениями, то свойство Application.GetAcadState().IsQuiescent равно True
Feb 26, 2020{%hackmd theme-dark %} Добавление объектов в Selection Set: object.select(mode,point1,point2,FilterType,FilterData) <Объектом (object) является selection set (SelSet)> Расшифровка параметров: mode, point1, point2 - определяют область выделения объектов в чертеже. :::spoiler Подробнее о параметрах
Feb 20, 2020or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up