Auto hat mini example syntax error

Hi,
I’m having trouble running the analog example for the Automation hat mini:

pi@rpi_garage:~/Pimoroni/automationhat/examples/hat-mini $ python analog.py
File “analog.py”, line 71
draw.text((text_x, text_y + offset), f"{reading:.2f}", font=font, fill=colour)
^
SyntaxError: invalid syntax

Any suggestions?
Thanks.

Are you running if from command line or from an IDE?
If from an IDE, does it highlight a specific part of that line?
I usually test run my python files from Idle3, it highlights the specific spot it doesn’t like.

I was running from the command line. I ran it from Idle3 and it puts ther cursor right at the Z in the line below (the Z isn’t in the code, just put here for illustration purposes):
draw.text((text_x, text_y + offset), f"{reading:.2f}"Z, font=font, fill=colour)

New to python so it’s probably an obvious issue!

It’s not obvious to me? I’m no expert, but I’m not a noob either.
The examples should just work?

I see what the problem is. The code uses an f-string, which requires Python 3.6+. I’m running an old OS with 3.5. Time to upgrade.

Wow, nice sleuthing, I doubt I would have figured that out.

You may be able to just do a dist-upgrade, and not have to start over. I am a Linux noob for sure though.