You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
830 B
31 lines
830 B
|
1 year ago
|
import csv
|
||
|
|
from flask import Flask, render_template
|
||
|
|
|
||
|
|
app = Flask(__name__)
|
||
|
|
|
||
|
|
def load_pokemon_data():
|
||
|
|
pokemon_list = []
|
||
|
|
earliest_games = {}
|
||
|
|
|
||
|
|
# Load Pokemon Home list
|
||
|
|
with open('pokemon_home_list.csv', 'r') as file:
|
||
|
|
reader = csv.DictReader(file)
|
||
|
|
for row in reader:
|
||
|
|
pokemon_list.append(row)
|
||
|
|
|
||
|
|
# Load earliest games data
|
||
|
|
with open('pokemon_earliest_games.csv', 'r') as file:
|
||
|
|
reader = csv.DictReader(file)
|
||
|
|
for row in reader:
|
||
|
|
earliest_games[row['Pokemon']] = row['Earliest Game']
|
||
|
|
|
||
|
|
return pokemon_list, earliest_games
|
||
|
|
|
||
|
|
@app.route('/')
|
||
|
|
def index():
|
||
|
|
pokemon_list, earliest_games = load_pokemon_data()
|
||
|
|
return render_template('index.html', pokemon_list=pokemon_list, earliest_games=earliest_games)
|
||
|
|
|
||
|
|
if __name__ == '__main__':
|
||
|
|
app.run(debug=True)
|