这条线怎么能引起';ValueError:无效的格式说明符';用python?

这条线怎么能引起';ValueError:无效的格式说明符';用python?,python,python-3.x,f-string,Python,Python 3.x,F String,我写了这行代码来格式化消息,但它给了我以下错误: Traceback (most recent call last): File "yes.py", line 221, in buy_stock message = f'{"action": "Bought {amount} stocks", "current-money": "{self.money}", "money-co

我写了这行代码来格式化消息,但它给了我以下错误:

Traceback (most recent call last):
  File "yes.py", line 221, in buy_stock
    message = f'{"action": "Bought {amount} stocks", "current-money": "{self.money}", "money-combined": "{self.money_combined}", "stocks" : "{self.stock_amount}"}'
ValueError: Invalid format specifier
用python3.8编写,定义了所有变量。
我试图将此消息做成json格式,这样我就可以将其发送到服务器,服务器会对数据进行一些信息收集。

用一对大括号括起来,如下所示

message = f'{{"action": "Bought {amount} stocks", "current-money": "{self.money}", "money-combined": "{self.money_combined}", "stocks" : "{self.stock_amount}"}}'