Aha, if you’re starting it like that via an SSH session it will still be attached to your controlling terminal, so when the SSH session dies, the application goes with it.
You should read about screen and how it can be used to keep things like this running between sessions: https://www.howtoforge.com/linux_screen
Although probably what you really want is a systemd unit to start up your Python script. Something like:
[Unit]
Description=My Python Service
After=multiuser.target
Requires=local-fs.target
[Service]
Restart=always
Type=simple
ExecStart=/usr/bin/python /home/pi/Pimoroni/unicornhathd/examples/candle.py
[Install]
WantedBy=default.target
Save this as a file by running: sudo nano /etc/systemd/system/mypython.service and pasting in the above.
Then reload systemd:
sudo systemctl daemon-reload
And start your new service:
sudo systemctl start mypython
You can also get its status:
sudo systemctl status mypython
And stop it:
sudo systemctl stop mypython
And enable it to auto-start on boot:
sudo systemctl enable mypython