The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Execute Python code in QM
#1
These functions can be used to execute Python code in QM.

Python setup

1. Download Python 32-bit (not 64-bit) from https://www.python.org/downloads/windows/
    Note: may not work with Python 3.12 and later. Works with 3.11.
2. Uninstall other versions of 32-bit Python.
3. Run the downloaded Python installer as administrator.
4. Check "Add python.exe to PATH".
5. Install.
6. Run cmd as administrator. Run it directly from explorer (eg Start menu), else it may inherit old environment variables.
7. In cmd run: where python
    It should print one or more paths. One of them must be of the new installed 32-bit Python. Copy it without "\python.exe" to the clipboard.
8. In cmd change current directory to the copied. Example:
    cd C:\Users\me\AppData\Local\Programs\Python\Python312-32
9. In cmd run: python -m pip install --upgrade pywin32
10. In cmd run one of the following. The first installs just what need for QM, the second something more.
    python Lib\site-packages\win32comext\axscript\client\pyscript.py
    python Scripts/pywin32_postinstall.py -install
11. Exit QM (not just close window). Run QM again. Now QM Python functions should work.

--
The SETUP instructions in the downloaded macro are now obsolete.


Attached Files
.qml   Python.qml (Size: 10 KB / Downloads: 1,060)


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)