To see the path of the python script, you can normally see it with
ps (using the
w, wide, option if needed):
~% ps ugxw | grep python romano 2136 0.0 0.2 10524 4132 ? S 09:13 0:00 python /home/romano/software/wallpap/bg_slideshow.py romano 5839 0.0 0.0 4440 832 pts/1 S+ 10:00 0:00 grep python
For example, process 2136 is the script
/home/romano/software/wallpap/bg_slideshow.py. If you want to know which is the working directory of the process, do
~% ls -l /proc/2136/cwd lrwxrwxrwx 1 romano romano 0 Nov 11 10:04 /proc/2136/cwd -> /home/romano
The process is running with
/home/romano as its current directory.
In the file
/proc/2136/cmdline there is the full command line specification --- the same you see in
ps, with the commands and argument separated by 0-valued bytes (to preserve the spaces). You can see it on your terminal with
% cat /proc/2136/cmdline | tr "\0" " " python /home/romano/software/wallpap/bg_slideshow.py %
where "tr" prints a space for each "nul" character found. (the spurious % at the end is due to the file not ending with a newline char).
The /proc filesystem is a really useful tool --- the full documentation is a bit "hard" but it's often useful to have a link to it: https://www.kernel.org/doc/Documentation/filesystems/proc.txt