Week 8 ( Python Part 2)
Python part 2
I wanted to explore more into python than I already had. Python is used for building websites and data analyzing. It is one of the more easier ones to learn when starting to code. It is very possible to learn a coding skill on your own. Python is a tool that can impact your career and can get you hired quickly.
I used Blackbox again to teach me more about Python. In my previous post I had Blackbox teach and how me different materials. It was able to play a ping pong game with Python on the website. I wanted to see what it can do and help me explore other websites. Today I had Python make me a website and teach me.
Website Building
In Blackbox Ai it gave me a step by step to making my own website. It gave me sources
Step 1 was to download Python and Flask
Step 2 was make a file and place these codes
step 3 was to make a template by1from flask import Flask, render_template 2 3app = Flask(__name__) 4 5@app.route('/') 6def home(): 7 return render_template('home.html') 8 9@app.route('/about') 10def about(): 11 return render_template('about.html') 12 13if __name__ == '__main__': 14 app.run(debug=True)
<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>Home</title>
7</head>
8<body>
9 <h1>Welcome to the home page!</h1>
10</body>
11</html>
Step 4 was to make the html
<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>About</title>
7</head>
8<body>
9 <h1>This is the about page!</h1>
10</body>
11</html>
Step 5 was to put in this code
1python app.py
Overall, I thought this process was interesting and how Ai can help you make websites.
Comments
Post a Comment