-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject2.py
More file actions
159 lines (136 loc) · 4.72 KB
/
project2.py
File metadata and controls
159 lines (136 loc) · 4.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import streamlit as st
# Page settings
st.set_page_config(page_title="Week 2 Python Project", page_icon="🐍")
st.title("🐍 Python Project 2")
st.write("This project explains why we selected PyCharm as our IDE. "
"It also explains the difference between code editors and IDEs. ")
# ----------------------
# 1. WHY PYCHARM
# ----------------------
with st.expander("Why We Selected PyCharm", expanded=False):
st.markdown("""
<div style='background-color:#f0f7ff;padding:15px;border-radius:10px;'>
<h3 style='color:#0066cc;'>Why We Selected PyCharm</h3>
</div>
""", unsafe_allow_html=True)
st.write("""
We selected PyCharm because it is easy to use.
It supports beginners.
It has many tools in one place.
It helps us write better Python code with less effort.
""")
st.subheader("Simple reasons why PyCharm is better")
st.write("""
1. It shows errors while typing.
2. It gives suggestions for functions and variables.
3. It has a built in debugger.
4. It supports virtual environments.
5. It manages libraries easily.
6. It has a nice interface with clear options.
""")
# ----------------------
# 2. Pycharm vs Others
# ----------------------
with st.expander("PyCharm vs Other IDEs", expanded=False):
st.markdown("""
<div style='background-color:#ffe8f0;padding:15px;border-radius:10px;'>
<h3 style='color:#cc0055;'>PyCharm vs Other IDEs</h3>
</div>
""", unsafe_allow_html=True)
st.write("""
Other IDEs are also good.
But PyCharm focuses only on Python.
This makes it clean and easy for students.
Some IDEs try to support many languages.
They become confusing for beginners.
PyCharm keeps things simple and clear.
""")
st.write("""
Example.
In Visual Studio Code you must install many extensions.
In PyCharm most features are already built in.
So beginners do not get confused.
""")
# ----------------------
# 3. IDE vs CODE EDITOR
# ----------------------
with st.expander("Difference Between IDEs and Code Editors", expanded=False):
st.markdown("""
<div style='background-color:#fff7d6;padding:15px;border-radius:10px;'>
<h3 style='color:#cc8a00;'>Difference Between Code Editors and IDEs</h3>
</div>
""", unsafe_allow_html=True)
st.write("""
A code editor is only for writing code.
It is simple.
It highlights keywords.
But it does not have extra tools.
Examples. Notepad++. VS Code. Sublime Text.
An IDE is a complete tool.
It includes editor, debugger, project tools, test tools, and environment support.
It is like a full workspace.
Examples. PyCharm. Eclipse. IntelliJ.
""")
# ----------------------
# 4. Features of IDEs
# ----------------------
with st.expander("What IDEs Can Do", expanded=False):
st.subheader("Simple examples of what IDEs can do")
st.write("""
- Run code inside the IDE
- Debug code
- Manage files in projects
- Install packages
- Test code
- Format code
""")
# ----------------------
# 5. Disadvantages
# ----------------------
with st.expander("Disadvantages of PyCharm", expanded=False):
st.markdown("""
<div style='background-color:#ffe4e4;padding:15px;border-radius:10px;'>
<h3 style='color:#990000;'>Disadvantages of PyCharm</h3>
</div>
""", unsafe_allow_html=True)
st.write("""
1. It uses more memory than small editors.
2. It takes longer to start.
3. Some features are paid.
""")
st.subheader("Why these disadvantages do not matter much")
st.write("""
PyCharm gives many tools that save time.
So using more memory is fine.
The free Community Edition is enough for students.
Startup time is not a big issue because we work inside the IDE for long time.
""")
# ----------------------
# 6. Beginner Tips
# ----------------------
with st.expander("Beginner Tips for PyCharm", expanded=False):
st.markdown("""
<div style='background-color:#e6ffee;padding:15px;border-radius:10px;'>
<h3 style='color:#008040;'>Beginner Tips for PyCharm</h3>
</div>
""", unsafe_allow_html=True)
st.write("""
- Create a new project and explore folders.
- Write small programs first.
- Use Run button on top.
- Use Terminal inside PyCharm to install packages.
- Try the debugger once to understand how code runs line by line.
""")
# ----------------------
# 7. Code Example
# ----------------------
with st.expander("Small Python Example", expanded=False):
st.subheader("Small Python Example")
st.code("""
def greet(name):
print("Hello", name)
greet("Tanush")
""")
# Footer
st.write("---")
st.write("End of Project. Thank you.")