<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><br><div class="gmail_quote"><div dir="ltr">On Fri, 23 Nov 2018 at 15:44, Kyle Altendorf <<a href="mailto:sda@fstab.net">sda@fstab.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On November 23, 2018 10:38:33 AM EST, J Barchan <<a href="mailto:jnbarchan@gmail.com" target="_blank">jnbarchan@gmail.com</a>> wrote:<br>
>On Fri, 23 Nov 2018 at 15:27, Kyle Altendorf <<a href="mailto:sda@fstab.net" target="_blank">sda@fstab.net</a>> wrote:<br>
><br>
>> Why not just specify the full path to execute? Setting PATH is for<br>
>> configuring other processes and being 'lazy' in a shell (reasonable<br>
>lazy,<br>
>> not bad lazy).<br>
>><br>
>> Cheers,<br>
>> -kyle<br>
>><br>
>> On November 23, 2018 4:14:42 AM EST, J Barchan <<a href="mailto:jnbarchan@gmail.com" target="_blank">jnbarchan@gmail.com</a>><br>
>> wrote:<br>
>> >On Fri, 23 Nov 2018 at 09:04, <<a href="mailto:kristof.mulier@telenet.be" target="_blank">kristof.mulier@telenet.be</a>> wrote:<br>
>> ><br>
>> >> Dear PyQt developers/users,<br>
>> >><br>
>> >> I'm using a QProcess()-instance to execute commands. The<br>
>> >QProcess()-instance<br>
>> >> automatically inherits the standard environment, for example the<br>
>PATH<br>
>> >> environment variable. So if the command is an executable, it can<br>
>only<br>
>> >find<br>
>> >> it if it's in the PATH variable.<br>
>> >> Once the QProcess()-instance exists, I just can't add anything to<br>
>> >its<br>
>> >> PATH variable. Well, actually I can, but it doesn't have any<br>
>effect.<br>
>> >I've<br>
>> >> explained everything in great details on StackOverflow:<br>
>> >><br>
>> >><br>
>> >><br>
>> ><br>
>><br>
><a href="https://stackoverflow.com/questions/53438065/how-can-i-add-a-path-to-the-qprocess-path-environment-variable-pyqt5-on-python" rel="noreferrer" target="_blank">https://stackoverflow.com/questions/53438065/how-can-i-add-a-path-to-the-qprocess-path-environment-variable-pyqt5-on-python</a><br>
>> >><br>
>> >> I would be very thankful if you can have a look at it :-)<br>
>> >><br>
>> >> Kind greetings,<br>
>> >><br>
>> >> Kristof Mulier<br>
>> >> _______________________________________________<br>
>> >> PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a><br>
>> >> <a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" rel="noreferrer" target="_blank">https://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
>> ><br>
>> ><br>
>> >I have posted a comment at *SO*:<br>
>> ><br>
>> >> I think you're misunderstanding. You are trying to affect the PATH<br>
>> >> environment which gets passed to the sub-process. What you *want*<br>
>to<br>
>> >do<br>
>> >> is simply alter the PATH environment in the *parent*, it is that<br>
>> >which<br>
>> >> needs to find your executable before the sub-process can get<br>
>spawned.<br>
>> >And<br>
>> >> if you want to, then change your parent's PATH back *after* the<br>
>> >> sub-process has been spawned<br>
>> >><br>
>><br>
><br>
>@Kyle<br>
>I would have suggested that! But the way I took the OP's full question<br>
>in<br>
>*SO* was "it *might* be on the PATH already, I don't know, so I just<br>
>want<br>
>to add something to the PATH to be sure just for this one-time spawn,<br>
>and<br>
>then let the OS find it somewhere for sure. And, I don't fancy doing<br>
>the<br>
>PATH search myself from code". :)<br>
<br>
If they know it's available in the new location and they put that first in the PATH, it's not going to look anywhere else. But sure, maybe there's more nuance somehow.<br>
<br>
Also, why the \r\n?<br>
</blockquote></div><div><br></div><div><div style="font-family:tahoma,sans-serif" class="gmail_default">@Kyle, @kristof</div><div style="font-family:tahoma,sans-serif" class="gmail_default">Have put a couple of further comments into the <b>SO</b> thread to bring Kyle's comments to OP's attention.<br></div><br></div><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-family:tahoma,sans-serif">Kindest,</span></div><div><span style="font-family:tahoma,sans-serif">Jonathan</span></div></div></div></div></div></div>