Unicorn pHat Issues

Hello there, I’m having a few issues with the Unicorn pHat code at the moment.
I’m running through the examples and when I type the code into the terminal everything works fine.
However if I use the same code as a saved python 3 script and call that script in the terminal, the LED flash on and straight back on.

This is the case for both this:

import unicornhat as uh
uh.set_layout(uh.PHAT)
uh.brightness(0.5)
uh.set_pixel(0, 0, 255, 0, 0)
uh.show()

and this:

import unicornhat as uh
uh.set_layout(uh.PHAT)
uh.brightness(0.5)

for x in range(8):
for y in range(4):
uh.set_pixel(x, y, 0, 255, 255)
uh.show()

The scipts in the examples folder all work fine when called from the terminal.

Is there some code I’m missing?

Many thanks

Paul