I am new to Python and working with a Raspberry Pi, and I have encountered what might appear to be a simple question, but it has proven to be quite challenging for me as a beginner. Despite my research, I haven't been able to find a suitable solution yet.
My goal is to have a Python script run automatically upon startup of the Raspberry Pi. However, I also want to view the script's output in a terminal window.
I placed a .desktop file in the directory /home/pi/.config/autostart, it contains the following content:
[Desktop Entry]
Version=1.0
Name=autostartProgram
Exec=/usr/bin/python3 /home/pi/Documents/autostart.py
Terminal=true
I know it's working because I hear the relay click, indicating that my GPIO output is functioning. Additionally, I see the red light on my USB camera, confirming that the Python script is accessing the camera. Everything seems to be working except that the terminal isn't opening, preventing me from seeing the output of my script. :(
It may be important, I'm running the Raspberry OS 64-bit Legacy version on a Raspberry Pi 4B with 8GB RAM; and the Pi automatically loads to desktop without the need of a user to enter a password.