Determine what the calling program is

Peter J. Holzer hjp-python at hjp.at
Mon Apr 19 17:10:32 EDT 2021


On 2021-04-19 08:04:10 +1200, dn via Python-list wrote:
> In a similar situation, one of my teams used an (OpSys) environment
> variable (available in both *nux and MS-Win).
> - when the application starts, it checks for the variable
> - if exists, stops running, else may proceed

That doesn't work on Unix-like OSs. An environment variable can only be
passwd to child processes, not to the parent or unrelated processes. So
it can't be used to lock out other processes - they wouldn't ever see
the variable.

        hp

-- 
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp at hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://mail.python.org/pipermail/python-list/attachments/20210419/a89fc39c/attachment.sig>


More information about the Python-list mailing list