Starting a python script on boot (startx) with an absolute path, in which there are relative paths -


I know that this question may already exist, but what I have found, I have not worked and my Have a little different setup nearby.

I have a Python file /home/pi/python_games/frontend.py when I try to start loading lxde by entering @ python / home / pi I am /python_games/frontend.py in the / etc / xdg / lxsession / LXDE / autostart .

It does not run and there are no error messages.

The home / pi / python_games / image.png is called from image.png . Obviously one solution would be to give these resources a complete path, but the Python program calls other dragon programs in their directories, which also have relative paths, and I do not want to change them all.

Any

You change your existing working directory inside Before the script you start making your relative import calls, use os.chdir ("the complete path to where your script remains").


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -