Preparing git repo for final project

This commit is contained in:
2023-07-09 11:19:26 +02:00
parent 6a38966eef
commit 63d06d6b35
67 changed files with 1587 additions and 0 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@@ -0,0 +1,22 @@
from fpdf import FPDF
def main():
username = input("What's your name?\t\t")
pdf = FPDF(orientation="P", unit="mm", format="A4")
pdf.set_auto_page_break(False)
pdf.add_page()
pdf.set_font("helvetica", "B", 45)
pdf.cell(0, 10, 'CS50 Shirtificate', new_x="LMARGIN", new_y="NEXT", align='C')
page_width = pdf.w
total_horizontal_margin = 0.2 * page_width
image_width = pdf.w-total_horizontal_margin
pdf.image("shirtificate.png", x=total_horizontal_margin/2, y=50, w=image_width)
pdf.set_font("helvetica", "B", 32)
pdf.set_text_color(255, 255, 255)
pdf.cell(0, 230, f'{username} took CS50', new_x="LMARGIN", new_y="NEXT", align='C')
pdf.output("shirtificate.pdf")
if __name__ == '__main__':
main()