Create a new file in /lib/systemd/system/ (rfidreader.service in my example) with a content like:
[Unit]
Description=Start Python RFID reader
[Service]
WorkingDirectory=/...Python script path.../
ExecStart=/usr/bin/python rfidreader.py
KillMode=process
[Install]
WantedBy=multi-user.target
Then execute the following command to install the service:
systemctl enable rfidreader.service
To start the service, you can reboot or execute
systemctl start rfidreader.service
To check if the service is running and get the latest outputs from the script:
systemctl status rfidreader.serviceExecStart=/usr/bin/python new_test.py-Chris