Spyder is a universal Python IDE. It is user-friendly and can be executed on both Windows and Linux. It can be used to run Python script automatically in order to build an automation system. This article will teach you how to execute Python script automatically when Spyder starts.
Prerequisite: You have to install Spyder on your system. You may encounter some issues during the installation of Spyder on Ubuntu 22.04. Check out my article to fix it.
Step 1: Start Spyder. Select Preferences in the Tools section.
Step 2: On the Ipython console section, select Startup, click the Use the following file button and then select the script you want to auto-start.
Restart the kernel, and your script will be auto-started.
The following article will teach you how to auto-restart your Python script on crash on Raspbian/Ubuntu.
If you use Windows 10, check out this article for the same purpose.