- in Python script, make sure include
#!/path/to/venv/python
in the first line - add a systemd service
$ sudo systemctl edit --force --full name.service
. In the editor complete at least these statments,
[Unit]
Description=Python Service
Wants=network.target
After=network.target
[Service]
ExecStartPre=/bin/sleep 10