I am trying to get my Raspberry Pi to open a terminal and run a Python script when it boots up. I have followed the instructions of some guides and have so far been unsuccessful.
My steps
I have made a Python file called testfile.py located in /home/pi/Documents/testfile.py
The contents are as follows:
print('hello')
input('press any key to exit')
I have added a file called testfile.desktop to /home/pi/.config/autostart/testfile.desktop.
The contents are as follows:
[Desktop Entry]
Type=Application
Name=testfile
Hidden=false
NoDisplay=false
Terminal=true
X-GNOME-Autostart-enabled=true
Exec=/usr/bin/python3 /home/pi/Documents/testfile.py
When I double click this file, the terminal opens and the Python script runs as expected, but when I reboot the Raspberry Pi the script doesn't run.