Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f475043

Browse files
AzzyAzzy
Azzy
authored and
Azzy
committed
final update
1 parent c8ee5ae commit f475043

File tree

4 files changed

+35
-16
lines changed

4 files changed

+35
-16
lines changed

‎.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"Arsalan",
55
"fpdf",
66
"Matplotlib",
7-
"prettytable"
7+
"prettytable",
8+
"pygame"
89
]
910
}

‎main.py

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
from fpdf import FPDF
22
from prettytable import PrettyTable
33

4-
article=PrettyTable(["Pros", "Cons"])
4+
# pdf = FPDF class
55
pdf = FPDF()
6+
# pdf page set to portrait, A4 size
67
pdf = FPDF(orientation="p", format="A4")
78

89
# adds page to document
910
pdf.add_page()
1011

11-
"""
12-
# adding images to document (with hyperlink)
13-
pdf.image("", x=175, y=5, w=30, h=30, link="")
14-
pdf.image("", x=175, y=37, w=30, h=30, link="")
15-
16-
"""
17-
12+
# title
1813
pdf.set_font("Arial", size=17)
19-
pdf.cell(w=0, h=5, txt="Why should you learn Python in 2022?", ln=1)
14+
pdf.cell(w=0, h=7, txt="Why should you learn Python in 2022?", ln=1)
2015

16+
# article by
2117
pdf.set_font("Arial", size=10)
22-
pdf.cell(w=0, h=10, txt="By Arsalan Arref", ln=1)
18+
pdf.cell(w=0, h=5, txt="By Arsalan Arref", ln=1)
19+
20+
pdf.set_font("Arial", size=8)
21+
pdf.set_text_color(194,8,6)
22+
pdf.cell(w=0, h=10, txt="This PDF has been coded with Python (FPDF library)")
2323

2424
# set position
2525
pdf.set_xy(x=10, y=30)
2626
pdf.set_font("Arial", style="B", size=10)
27+
pdf.set_text_color(0,0,0)
2728
pdf.cell(w=0, h=5, txt="Temp", ln=1)
2829

2930
pdf.set_font("Arial", size=10)
@@ -62,7 +63,7 @@
6263
"* Diabetes prediction\n"+
6364
"* Breast cancer detection")
6465

65-
66+
# 2. data visualization
6667
pdf.set_xy(x=10, y=150)
6768
pdf.set_font("Arial", style="B", size=10)
6869
pdf.cell(w=0, h=5, txt=" 2. Data Visualization", ln=1)
@@ -75,16 +76,33 @@
7576
"Examples of data visualization:\n"+
7677
"https://www.tableau.com/learn/articles/best-beautiful-data-visualization-examples")
7778

79+
# data visualization image
7880
pdf.image("data-visualization.png", x=10, y=180, w=90, h=50)
7981

80-
pdf.set_xy(x=10, y=235)
82+
# 3. game development
83+
pdf.set_xy(x=105, y=190)
84+
pdf.set_font("Arial", style="B", size=10)
85+
pdf.cell(w=0, h=5, txt=" 3. Game Development", ln=1)
86+
87+
pdf.set_xy(x=105, y=200)
88+
pdf.set_font("Arial", size=10)
89+
pdf.multi_cell(w=95, h=5, txt="You can use PyGame library to create your very own 2D games, for example, "+
90+
"Flappy Bird, Snake, Chess, World of Tanks and so much more!."+
91+
"You can find games created and published by the community in the link below: "+
92+
"https://www.pygame.org/news")
93+
94+
95+
pdf.set_xy(x=10, y=240)
8196
pdf.set_font("Arial", style="B", size=10)
82-
pdf.cell(w=0, h=5, txt=" 3. Game Development")
97+
pdf.cell(w=0, h=5, txt=" Conclusion", ln=1)
8398

8499
pdf.set_font("Arial", size=10)
85-
pdf.multi_cell(w=0, h=5, txt="You can use PyGame library to create your very own 2D games, for example, "+
86-
"Flappy Bird, Snake, Chess, World of Tanks and so much more!.")
100+
pdf.multi_cell(w=120, h=5, txt="There are many applications that you can create with Python, from scraping "+
101+
"live data, to creating automation's, so much more."+
102+
"Take a look at my GitHub repositories for some ideas on what "+
103+
"you can create: https://github.com/Azzy001")
87104

105+
pdf.image("pygame.jpg", x=140, y=240, w=60, h=50)
88106

89107
# name document and add its path
90108
pdf.output("project.pdf")

‎project.pdf

29.6 KB
Binary file not shown.

‎pygame.jpg

30.7 KB
Loading[フレーム]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /