alp*_*per 5 python pylint f-string
对于以下行:
print("{0: <24}".format("==> core=") + str(my_dict["core"]))
我收到以下警告消息:
[考虑使用 f 字符串] 格式化可能是 f 字符串的常规字符串 [C0209]
我可以使用重新格式化它吗f-string?
f-string
Pie*_*las 6
您可以将代码更改为print(f"{'==> core=': <24}{my_dict['core']}"). 转换为字符串是隐式的。
print(f"{'==> core=': <24}{my_dict['core']}")
归档时间:
4 年,1 月 前
查看次数:
8582 次
最近记录:
3 年,12 月 前