OPERATING SYSTEMSOS Linux

Run Python Script on Startup – Ubuntu

Visit the website at https://jetsonhacks.com
Sign up for the newsletter! https://newsletter.jetsonhacks.com
Join this channel to get access to perks:
https://www.youtube.com/channel/UCQs0lwV6E4p7LQaGJ6fgy5Q/join

Running a Python script on System Startup is usually one of the things people want to do once they get their feet wet in Ubuntu and Jetson Development. Here we go over on how to auto start a Python script on boot on a NVIDIA Jetson Nano. This method works on the other Jetsons as well, like the Jetson Xavier and Jetson Orins. Here’s the script we are working with:

#!/usr/bin/python3
import tkinter as tk

#Create the main window
root = tk.Tk()
root.title(“Startup Script Test”)

#Create a label with a message
label = tk.Label(root, text=”This script runs at startup”, font=(“Helvetica”, 16))
label.pack(pady=20, padx=20)

#Run the application
root.mainloop()

Hope this helps!

As an Amazon Associate I earn from qualifying purchases.
Visit the JetsonHacks storefront on Amazon: https://www.amazon.com/shop/jetsonhacks

Visit the website at https://jetsonhacks.com
Sign up for the newsletter! https://newsletter.jetsonhacks.com
Github accounts: https://github.com/jetsonhacks
https://github.com/jetsonhacksnano
Twitter: http://twitter.com/jetsonhacks

Some of these links here are affiliate links. As an Amazon Associate I earn from qualifying purchases at no extra cost to you.

source

ubuntu

3 thoughts on “Run Python Script on Startup – Ubuntu

Comments are closed.