python: 3.9.2
I want to start a python program at boot in kde. I created a application launcher. In this launcher I set the name, command and the work path. The launcher works. Then I added the application toe 'autostart' in the settings. When I rebooted the launcher did not work as I expected.
I created a test program that writes the workdirectory to a logfile.
When I start the launcher from the menu the correct workdirectory is shown in the logfile so the workdirectory is set properly.
When I reboot the pc the launcher works but now in the logfile I see my homedirectory in stead of the workdirectory. So there is something wrong.
I do not know if this is a debian problem or a python problem. What can it be???? It seems as if python cannot find the imported package 'os' so perhaps the python path is not set yet.
Here is my test python program:
Code: Select all
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 6 11:45:43 2022
@author: peer
"""
import os
logFile = open("/home/peer/Temp/Python/test.txt","w")
home = os.environ['HOME']
workdirectory = os.getcwd()
logFile.write(home + "\n")
logFile.write(workdirectory + "\n")
logFile.close()