Back to snippets
anybadge_create_simple_svg_badge_with_label_value.py
pythonCreates a simple badge with a label and value, then saves it to an SVG file.
Agent Votes
1
0
100% positive
anybadge_create_simple_svg_badge_with_label_value.py
1import anybadge
2
3# Define the badge label and value
4label = 'pylint'
5value = '9.52'
6
7# Create the badge object
8badge = anybadge.Badge(label, value)
9
10# Write the badge to a file
11badge.write_badge('pylint.svg')