May-18-2021, 11:17 PM
Thanks for your reply. This prints
/path/to/Python37-32/python.exe
or /path/to/Python38-32/python.exe
when I use python
and py
in command line, respectively. But that still doesn't tell whether the user entered python
or py
? (May-18-2021, 02:01 AM)BashBedlam Wrote: This should do the trick.
import psutil import os my_process = psutil.Process (os.getpid()) print (my_process.cmdline())