generate_packets.py: use str.format() instead of old printf-style
Part of #43927. Preparation for #44574 and #44575. Update string formatting to str.format() where reasonable, both to avoid some pitfalls, and to prepare for more advanced uses (e.g. member and item access).
Depends on #44563
Part of #43927. Preparation for #44574 and #44575. Update string formatting to str.format() where reasonable, both to avoid some pitfalls, and to prepare for more advanced uses (e.g. member and item access).