Adding a script to autoload
After writing the above code, it’s time to add this Python script to run. This can be done in Ubuntu as follows:
- First, we need to create an executable file for our remder.py script
- This can be done by typing the following command in the terminal
sudo chmod + x reminder.py , where reminder.py is our script file name
- Now we need to transfer this file along the path where Linux looks for default files:
Enter this command in a terminal:
sudo cp /path/to/our/reminder.py / usr / bin
This will add our executable script to / usr / bin.
- In the global search, search for Startup Applications
- Click on Add and give the desired name for your process
- Enter the command. For example, our filename — filederder.py, then enter remder.py in the command field and select Add.
NOTE . The script runs automatically (after being added to startup) every time the system starts. Also, if you have more than two birthdays on the same day, both notifications will be notified in a notification.
What the birthday file should look like
Output after script run
This article is provided by Omkar Pathak . If you are as Python.Engineering and would like to contribute, you can also write an article using contribute.python.engineering or by posting the article [email protected] ... See my article appearing on the Python.Engineering homepage and help other geeks.
Please post comments if you find anything wrong or if you would like to share more information on the topic discussed above.