I can not launch a python script from a .desktop launcher created on Linux Mint 17.1 Cinnamon.
The problem is that the script will be launched in the wrong path - namely the home folder instead of the directory it is placed in. Thereby it can not find other vital files accompanying it in its folder and hence does not work.
To examine that misbehaviour I created a short script to check the folder a python script is executing in:
#!/usr/bin/env python
import subprocess
import time
subprocess.call(["pwd"], shell=True)
time.sleep(7) # to get a chance to read the output
Executing it from its own folder gives the output:
/home/myusername/PythonProjects
I am setting a desktop launcher via Nemo's menu. Now executing the same script yields:
/home/myusername
I do not understand this behaviour. How could I create a working desktop launcher for my python script?