I've installed the Python and Python Wheels kit on my OpenVMS x86 V9.2-3 virtual machine, and want to tinker with Flask.
The Flask "quick-start" guide makes mention of defining environment variables such as FLASK_APP and FLASK_ENV, but no matter how I define them, Flask doesn't find them. I tried logical names and local and global DCL variables.
Flask, like many other Python modules, uses os.environ to look for these variables. But it seems that on OpenVMS, os.environ has a fixed set of values:
Code: Select all
VSMX86» my_test_symbol := symbol
VSMX86» show sym my_test_symbol
MY_TEST_SYMBOL = "SYMBOL"
VSMX86» define my_test_symbol logical
VSMX86» show log my_test_symbol
"MY_TEST_SYMBOL" = "logical" (LNM$PROCESS_TABLE)
VSMX86» python
Python 3.10.0 (default, Feb 21 2024, 05:22:10) [C] on OpenVMS
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.environ
environ({'PATH': '/DISK$USERS/JEREMY', 'HOME': '/DISK$USERS/JEREMY', 'TERM': 'vt400-132', 'USER': 'JEREMY', 'PYTHONHOME': '/python$r
oot'})
>>> os.environ.get('MY_TEST_SYMBOL')
>>> os.getenv('MY_TEST_SYMBOL')
'logical'
>>>
It would appear this is NOT the case in VSI Python. Is there a workaround, so that modules which use os.environ will work?
Thanks
Jeremy Begg