[PyQt] How can I add a path to the QProcess PATH environment variable?
jnbarchan at gmail.com
Fri Nov 23 15:38:33 GMT 2018
On Fri, 23 Nov 2018 at 15:27, Kyle Altendorf <sda at fstab.net> wrote:
> Why not just specify the full path to execute? Setting PATH is for
> configuring other processes and being 'lazy' in a shell (reasonable lazy,
> not bad lazy).
> On November 23, 2018 4:14:42 AM EST, J Barchan <jnbarchan at gmail.com>
> >On Fri, 23 Nov 2018 at 09:04, <kristof.mulier at telenet.be> wrote:
> >> Dear PyQt developers/users,
> >> I'm using a QProcess()-instance to execute commands. The
> >> automatically inherits the standard environment, for example the PATH
> >> environment variable. So if the command is an executable, it can only
> >> it if it's in the PATH variable.
> >> Once the QProcess()-instance exists, I just can't add anything to
> >> PATH variable. Well, actually I can, but it doesn't have any effect.
> >> explained everything in great details on StackOverflow:
> >> I would be very thankful if you can have a look at it :-)
> >> Kind greetings,
> >> Kristof Mulier
> >> _______________________________________________
> >> PyQt mailing list PyQt at riverbankcomputing.com
> >> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
> >I have posted a comment at *SO*:
> >> I think you're misunderstanding. You are trying to affect the PATH
> >> environment which gets passed to the sub-process. What you *want* to
> >> is simply alter the PATH environment in the *parent*, it is that
> >> needs to find your executable before the sub-process can get spawned.
> >> if you want to, then change your parent's PATH back *after* the
> >> sub-process has been spawned
I would have suggested that! But the way I took the OP's full question in
*SO* was "it *might* be on the PATH already, I don't know, so I just want
to add something to the PATH to be sure just for this one-time spawn, and
then let the OS find it somewhere for sure. And, I don't fancy doing the
PATH search myself from code". :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PyQt