F String Invalid Syntax in Python 3.5 [closed]

For older versions of Python (before 3.6):

Using future-fstrings:

pip install future-fstrings 

you have to place a special line at the top of your code:

coding: future_fstrings

Hence in your case:

# -*- coding: future_fstrings -*-
# rest of the code
location = fromstr(f'POINT({longitude} {latitude})', srid=4326)

Leave a Comment