Desktop Launcher for Python Script Starts Program in Wrong Path (Linux) -


i can not launch python script .desktop launcher created on linux mint 17.1 cinnamon.

the problem script launched in wrong path - namely home folder instead of directory placed in. thereby can not find other vital files accompanying in folder , hence not work.

to examine misbehaviour created short script check folder python script executing in:

#!/usr/bin/env python  import subprocess import time  subprocess.call(["pwd"], shell=true) time.sleep(7)  # chance read output 

executing own folder gives output:

/home/myusername/pythonprojects 

i setting desktop launcher via nemo's menu. executing same script yields:

/home/myusername 

i not understand behaviour. how create working desktop launcher python script?

the page https://linuxcritic.wordpress.com/2010/04/07/anatomy-of-a-desktop-file/ describes format of .desktop files.

you may note "path" element, specifies working directory file run in. in case want desktop file specified

path=/home/myusername/pythonprojects 

if nemo doesn't allow set path element may need edit desktop file hand. .desktop files text files , can find them in /home/myusername/.local/share/applications/


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -