I’m working with an application that requires the user to source environment variables from a file into Bash. However, I cannot see these new env variables in Qt.
In Bash, once the file has been sourced, I can access the new variables via os.getenv(). But if I try to do that within Qt, it says those new variables don’t exist, i.e. get a return value of “None”.
Elsewhere in the Qt code, I can run a subprocess to execute Bash, call the source command, and gain access to the special commands from the external application, such as the code below (“ocpidev” is a command from the external application):
That’s incredibly helpful. I just need to figure out why my Qt application doesn’t seem to make the system Bash environment available. While the CLI shows the sourced env vars, Qt indicates that they aren’t available.
But when I have more time, I can investigate. However, the envbash package you suggested does seem to provide more information.