1

I have made executable file of python tkinter application. It runs well when clicked. But I want to run it at Boot time (AutoStart) in Raspberry Pi Os.

I have tried many methods but they didn't work.

One method which I tried will other applications:

> sudo nano /etc/xdg/lxsession/LXDE-pi/autostart 

@/home/pi/Downloads/exes/project2/work/dist/homeP (@path_of_file/applicatin_name)

This didn't work with my Current application, Even no error is observed. Please help me ??

I have tried many methods but they didn't work.

2
  • is /home/pi/Downloads/exes/project2/work/dist/homeP an executable? Dec 1, 2022 at 9:50
  • @Jaromanda X Yes, It is executable and it has execute permission too. Dec 3, 2022 at 5:11

1 Answer 1

0

Try to create a bash file to execute your Tkinter app like:

startapp.sh

#!/bin/bash

cd /home/pi/Downloads/exes/project2/work/dist/
python3 your_app.py

Then edit the autostart file:

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

Put your startapp in the autostart file:

@sh /home/pi/Downloads/exes/project2/work/dist/startapp.sh
3
  • 2
    Why is everything using sudo? That's supposed to be a secure command that you use sparingly.
    – Dougie
    Dec 1, 2022 at 16:51
  • Thanks You so much, It works. Dec 3, 2022 at 5:06
  • @Elmer Thanks You so much, It works. Dec 3, 2022 at 5:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.