Anup Sarkar Anup Sarkar - 11 months ago 124
Linux Question

How to run a python program(containing tkinter) on startup

I want to execute a simple python script that contain tkinter window on start up of raspberry pi. and the tkinter window will appear on the monitor. suppose my simple script is

import Tkinter
from Tkinter import *
root = Tk()

I have tried the following procedure and failed

mkdir ./bin
cd ./bin
sudo nano script_auto_run

then wrote the following code

sudo python /home/pi/projects/

to make it executable i ran

sudo chmod 755 script_auto_run

edited the rc.local file

sudo nano /etc/rc.local

and added the following line before exit0


what mistake am I doing?


Open /etc/profile and put this line at the bottom

sudo python /home/pi/projects/