Python offers a useful means of extracting data from Flexcom results databases, given its ease of use, flexibility, and suitability for first-time programmers. The simplest way to use Python with Flexcom is to invoke the VBA functions which underpin Flexcom's Excel Add-in. Note that Example J02 - Advanced Database Postprocessing includes a sub-section on data retrieval via Python, so this article covers Python installation.
You can find the latest installation packages from the Python Windows Downloads section of the Python website.
Because Flexcom's Excel Add-in is 32-bit, you will need to install 32-bit Python at a minimum. However as many computers are 64-bit, it is recommended that you install 64-bit Python also in order to avail of the additional functionality which it offers.
In addition to installing the basic Python framework (via the downloads link), generally you will need to install additional Python packages. The best way to do this is via the pip command (pip is the Package Installer for Python). Any Python package may be installed using the following steps:
•Open a command prompt window. You can do this by typing CMD into the Windows search box.
•Type the location of the Python pip script (depending on whether you wish to install a 32-bit or 64-bit package), followed by the word install, followed by the name of the package you require. Then press Enter. The following line shows you how to install a 32-bit of the pythonnet package (Python.NET library).
•"C:\Users\firstname.lastname\AppData\Local\Programs\Python\Python312-32\Scripts\pip" install pythonnet
In order to use Flexcom's VBA functions, you must install pythonnet 32-bit.
We also recommend that you install 64-bit versions of pandas, numpy, matplotlib and openpyxl.
When you install Python (via the downloads link above), the location of the executable is automatically added to the Windows System PATH variable. However, if you tend to use Python 64-bit almost exclusively, you may wish to manually remove the Python 32-bit location from the Windows System PATH. This offers convenience in the sense that you can run Python files (with .py file extension) from the command prompt, without having to provide the location of the Python executable, safe in the knowledge that your computer will use Python 64-bit. In other words, the following two commands would achieve the same effect...
•"C:\Users\firstname.lastname\AppData\Local\Programs\Python\Python312\python.exe" Code.py
•python Code.py
If you wish, you can edit the system PATH by typing "Environment Variables" into the Windows search box. This does not mean that you cannot use Python 32-bit, you can still use it by including the full path to the executable, as shown in the first command above.