4

I have written a Python3.7.1 code, and I need to run it in Python3.5 (because I have to run it from Raspberry), an error shows up:

teams = requests.get(f'http://api.football-data.org/v2/competitions/{league}/standings', headers=headers, timeout = 10).json()
SyntaxError: invalid syntax

The error appears on the first comma (...standings', headers...)

I suppose this is because of python3.5 don't support the same things that 3.7.

I have tried to install Python 3.7 in raspberry but have no good results

teams = requests.get(f'http://api.football-data.org/v2/competitions/{league}/standings', headers=headers, timeout = 10).json()

Thanks for the help

0

1 Answer 1

4

The issue here is that the f string is supported since python 3.6. As you are using python 3.5, you can use an equivalent:

url = 'http://api.football-data.org/v2/competitions/{}/standings'.format(league)

Here you can find some information about string formatting.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.