[Python] How can I get the Autocard version on Windows in Python?

Discussão em 'Python' iniciado por Stack, Setembro 29, 2024.

  1. Stack

    Stack Membro Participativo

    I am working on a Python script that monitors when AutoCAD is opened in a system. I have tried as follows:

    import wmi
    c = wmi.WMI()
    process_creation_watcher = c.Win32_Process.watch_for("creation")
    creation_event = process_creation_watcher()
    process_name = creation_event.Caption
    print(process_name)


    Currently, it prints "acad.exe" for all types of AutoCAD. AutoCAD has several verticals, like "AutoCAD Civil 3D 2016", "AutoCAD Map 3D 2024", "AutoCAD 2025", "AutoCAD LT 2025", etc. How can I get the full name of software with version like "AutoCAD Civil 3D 2016" in place of "acad.exe"? Thanks in advance.

    Currently, it prints "acad.exe" for all types of AutoCAD. AutoCAD has several verticals, like "AutoCAD Civil 3D 2016", "AutoCAD Map 3D 2024", "AutoCAD 2025", "AutoCAD LT 2025", etc. How can I get the full name of software with version like "AutoCAD Civil 3D 2016" in place of "acad.exe"? Thanks in advance.

    Continue reading...

Compartilhe esta Página