LIN: How to make python script run as systemd service

please remember to set executions right on the script and add shebang at the begging:

shebang:

#!/bin/python3

create file:

sudo nano /etc/systemd/system/python-script.service

insert below code into file:

[Unit]
Description=Python script
After=multi-user.target

[Service]
WorkingDirectory=/path/to/working/directory
Type=simple
User=admin
Group=admin
Restart=always
ExecStart=/path/to/your/script

[Install]
WantedBy=multi-user.target

then execute:

sudo systemctl daemon-reload
sudo systemctl enable python-script.service
sudo systemctl start python-script.service