Learning Python and Flask
Eh hello everyone! So, I decided to start learning Python and this thing called Flask. I thought I’d share my journey, you know, in case anyone else is keen to try also can learn together.
Why Python and Flask?
Okay, so Python, right, is like super popular now. Apparently, it’s easy to learn also. People use it for all sorts of things like web development, data stuff, and even AI. Since I want to build web applications, i think this will be quite useful.
Then there’s Flask. Flask is a framework that helps you create web apps with Python. It’s small and simple, so its good for beginners. Plus, can use things like HTML to make the website look nicer.
First Steps
So, first thing first, I had to install Python. After installing Python, i need to install Flask. According to what I read online, just need to type this in the command line:
pip install flask
Then create a file called app.py
. Inside app.py
, write some code:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello, World!'
This code will display “Hello, World!” on the web browser.
Challenges and What I’m Learning
For now everything seems ok. But I am sure more challenges will come. Anyway these are some of the things I’m trying to learn:
- Variables: How to store data
- Operators: How to do calculations
- Control Flow: How to make the program do different things based on certain conditions
- Functions: How to group code together to make it easier to reuse
- HTML: How to structure the layout of the website
- CSS: How to style the website and make it look good
What’s Next?
I’m planning to build a simple blog using Flask. I want to learn how to create pages, display posts, and add some styling. Hopefully can create a working website.
Wish me luck! I will update again when I learn new things.