python with environment variable running at boot
Posted: Thu Jul 30, 2020 10:05 pm
Hi to all, I know that the web is full of guides on how to start a python script at the boot, but I'm here to ask your help since I've unsuccessfully tried everything I could, everything I've found.
The script by command line works great without any error/exception. After lots of trying I've understood what blocks it.
My script (python2.7 with debian buster) starts with
where prog_path is an environment variables setted in ~/.bashrc adding this line at the end:
export prog_path="/home/pi/programfldr/prog_path "
what I've found is that this line doesn't allow the script to run
I made this test: after this line I just ask python simple creating a folder. If I comment the line, it works perfectly, if not it's not works at all.
Can please someone help me to solve it?
Thanks a lot guys
The script by command line works great without any error/exception. After lots of trying I've understood what blocks it.
My script (python2.7 with debian buster) starts with
Code: Select all
import os
import os.path
import json
prog_path = os.environ.get('prog_path')
Settings = os.path.join(prog_path, 'Settings.json')
export prog_path="/home/pi/programfldr/prog_path "
what I've found is that this line doesn't allow the script to run
Code: Select all
Settings = os.path.join(prog_path, 'Settings.json')
Can please someone help me to solve it?
Thanks a lot guys